Advertisement
Sam_P

Geek Tool Circle volume

Sep 14th, 2011
7,481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- new version at http://pastebin.com/FjTKv05t
  2.  
  3. -- original at https://midnighttokerkate.deviantart.com/art/circle-volume-update-257250247
  4.  
  5. property previousVolume : -1
  6. property previouslyMuted : false
  7. on run
  8.     set pathName to "/PATHTOSCRIPT/Circle_VolumeIndicator"
  9.     set rawVolume to output volume of (get volume settings) as integer
  10.     if previousVolume is not equal to rawVolume then
  11.         set previousVolume to rawVolume
  12.         set finalVolume to rawVolume * 16 / 100 + 1 as integer
  13.         do shell script ("cp " & pathName & "/Images_White/" & finalVolume & ".png " & pathName & "/temp.png")
  14.     end if
  15.     set outputMuted to output muted of (get volume settings) as boolean
  16.     if outputMuted then
  17.         if previouslyMuted is not equal to outputMuted then
  18.             set previouslyMuted to outputMuted as boolean
  19.             set finalVolume to 1 as integer
  20.             do shell script ("cp " & pathName & "/Images_White/" & finalVolume & ".png " & pathName & "/temp.png")
  21.         end if
  22.     else
  23.         if previouslyMuted is not equal to outputMuted then
  24.             set previouslyMuted to outputMuted as boolean
  25.             set finalVolume to rawVolume * 16 / 100 + 1 as integer
  26.             do shell script ("cp " & pathName & "/Images_White/" & finalVolume & ".png " & pathName & "/temp.png")
  27.         end if
  28.     end if
  29. end run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement