Advertisement
Guest User

Untitled

a guest
Jun 8th, 2018
618
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 hOffset to (h + 20) mod 24
  10. -- set default periodOfDay
  11. set imageNumber to (round ((hOffset + (m / 60)) * 16.0 / 24.0) rounding down) + 1
  12. --set imageNumber to 14
  13. tell application "System Events"
  14.    
  15.     -- wrapped in a try block for error suppression
  16.     try
  17.         set desktopCount to count of desktops
  18.         repeat with desktopNumber from 1 to desktopCount
  19.             tell desktop desktopNumber
  20.                 set picture to current_path & "mojave_dynamic_" & (imageNumber as string) & ".jpeg"
  21.             end tell
  22.         end repeat
  23.     end try
  24.    
  25. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement