AppleScript名:ディスク使用状況を取得 |
— Created 2017-12-17 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set dRes to diskUsage() of me –> {readSector:8557760, readSize:"152G", writeSecotr:2601227, writeSize:"100G"} on diskUsage() set dRes to (do shell script "top -l 1 | head -10 | grep ’Disks:’") set dList to words of dRes set readSectorNum to (contents of item 2 of dList) as integer set readSizeNum to contents of item 3 of dList set writeSectorNum to (contents of item 5 of dList) as integer set writeSizeNum to contents of item 6 of dList return {readSector:readSectorNum, readSize:readSizeNum, writeSecotr:writeSectorNum, writeSize:writeSizeNum} end diskUsage |
More from my site
(Visited 27 times, 1 visits today)