Guest User

Untitled

a guest
Sep 16th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tell application "Finder"
  2.     # Finder gets the free space in bytes
  3.     set free_space to the free space of the startup disk
  4.    
  5.     # convert to MB
  6.     set free_space_in_MB to free_space / 1.0E+6 as integer
  7.    
  8.     # How many whole GB?
  9.     set free_space_in_GB to round (free_space_in_MB / 1000) rounding down
  10.    
  11.     # How many MB remaining once we have subracted the GB?
  12.     set remaining_MB to free_space_in_MB - free_space_in_GB * 1000
  13.    
  14.     # Et voilá!
  15.     say "There is " & free_space_in_GB & " gigabytes and " & remaining_MB & " megabytes of free space left on the disk."
  16. end tell
Add Comment
Please, Sign In to add comment