Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tell application "Finder"
- # Finder gets the free space in bytes
- set free_space to the free space of the startup disk
- # convert to MB
- set free_space_in_MB to free_space / 1.0E+6 as integer
- # How many whole GB?
- set free_space_in_GB to round (free_space_in_MB / 1000) rounding down
- # How many MB remaining once we have subracted the GB?
- set remaining_MB to free_space_in_MB - free_space_in_GB * 1000
- # Et voilá!
- say "There is " & free_space_in_GB & " gigabytes and " & remaining_MB & " megabytes of free space left on the disk."
- end tell
Add Comment
Please, Sign In to add comment