Guest User

Untitled

a guest
Oct 24th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/osascript
  2.  
  3. -- by decky (cosstropolis.com)
  4.  
  5. on run argv
  6.  
  7.     set picOnline to (item 1 of argv)
  8.     set picOffline to (item 2 of argv)
  9.     set picOfflineCopy to "NEW" & picOffline
  10.     set picFolder to "~/Documents/dev/changedesktop/"
  11.  
  12.     set output to (do shell script ("curl -I " & picOnline))
  13.     if "200 OK" is in output then
  14.         do shell script ("curl " & picOnline & "> " & picFolder & picOffline)
  15.     else
  16.         return
  17.     end if
  18.  
  19.     do shell script("python -c \"import os; os.chdir(os.path.expanduser('" & picFolder & "')); import deckyGIF; deckyGIF.randomize('" & picOffline & "', '" & picOfflineCopy & "', 13, 36)\"")
  20.  
  21.     tell application "Finder"
  22.         set desktop picture to file {"Macintosh HD:Users:david:documents:dev:changedesktop:tran.gif"}
  23.         set desktop picture to file {"Macintosh HD:Users:david:documents:dev:changedesktop:" & picOfflineCopy}
  24.     end tell
  25.  
  26. end run
Add Comment
Please, Sign In to add comment