Advertisement
Guest User

mojave image set

a guest
Jun 8th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- get current time
  2. set h to hours of (current date)
  3. set m to minutes of (current date)
  4.  
  5. tell application "Finder"
  6.     set current_path to (container of (path to me) as text)
  7. end tell
  8.  
  9. -- set default periodOfDay
  10. set imageNumber to (round ((h + (m / 60)) * 16.0 / 24.0) rounding down) + 1
  11.  
  12. tell application "System Events"
  13.    
  14.     -- wrapped in a try block for error suppression
  15.     try
  16.         set desktopCount to count of desktops
  17.         repeat with desktopNumber from 1 to desktopCount
  18.             tell desktop desktopNumber
  19.                 set picture to current_path & "mojave_dynamic_" & (imageNumber as string) & ".jpeg"
  20.             end tell
  21.         end repeat
  22.     end try
  23.    
  24. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement