AppleScript名:指定フォルダが所属しているDiskの空き容量をGバイト単位で返す |
— Created 2015-04-02 by Shane Stanley use AppleScript version "2.4" use scripting additions use framework "Foundation" set aFol to choose folder set aFolPOSIX to POSIX path of aFol set fRes to freeStorageSpaceG(aFolPOSIX) –指定フォルダが所属しているDiskの空き容量をGバイト単位で返す on freeStorageSpaceG(volumePath) set fileAttr to current application’s NSFileManager’s defaultManager()’s attributesOfFileSystemForPath:volumePath |error|:(missing value) set fileFree to (fileAttr’s objectForKey:(current application’s NSFileSystemFreeSize)) set sizeString to current application’s NSByteCountFormatter’s stringFromByteCount:fileFree countStyle:(current application’s NSByteCountFormatterCountStyleDecimal) return sizeString as text end freeStorageSpaceG |
More from my site
(Visited 100 times, 1 visits today)