Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set fileExists to "no"
  2. tell application "Finder"
  3.     if exists POSIX file "/tmp/oldvolume" then
  4.         set fileExists to "yes"
  5.     end if
  6. end tell
  7.  
  8. tell application "iTunes"
  9.     if fileExists = "yes" then
  10.         set target to do shell script "cat /tmp/oldvolume"
  11.         set target to target * 1
  12.         repeat while sound volume < target
  13.             set sound volume to (sound volume + 1)
  14.         end repeat
  15.         do shell script "rm /tmp/oldvolume"
  16.     else
  17.         do shell script "echo " & sound volume & " > /tmp/oldvolume"
  18.         set target to (sound volume / 2)
  19.         repeat while sound volume > target
  20.             set sound volume to (sound volume - 1)
  21.         end repeat
  22.     end if
  23. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement