bharadwaj-raju / WeatherDesk

MOVED: https://gitlab.com/bharadwaj-raju/WeatherDesk
https://gitlab.com/bharadwaj-raju/WeatherDesk
GNU General Public License v3.0
217 stars 31 forks source link

Applescript doesn't like single quotes #2

Closed baztastic closed 8 years ago

baztastic commented 8 years ago

Minor fix for OS X errors, replacing single quotes with double quotes, and removing "to":

Desktop.py, lines 270-274:

                OSX_SCRIPT = '''tell application "Finder"
set desktop picture to POSIX file "%s"
end tell
                ''' % image
bharadwaj-raju commented 8 years ago

You're right about the single quotes, but the to is required. Fixing.

baztastic commented 8 years ago

The to throws an error for me: .weatherdesk_script.sh:26:29: script error: A end of line can’t go after this “to”. (-2740) For multiline tells you don't need the to.

bharadwaj-raju commented 8 years ago

Oh, I see. You mean the to after "Finder" - I thought you meant the to after picture. Fixing.

bharadwaj-raju commented 8 years ago

Fix committed. Please test.

bharadwaj-raju commented 8 years ago

Also, does the AppleScript Python API (appscript) not work? Because the script file is meant to be called only when that doesn't work.

baztastic commented 8 years ago

Yep works for me, thanks!

Also just so you know, on OS X, if the "Desktop & Screen Saver" preference is set to automatically change every X minutes, it resets the background immediately after your script changes it, so the auto change setting should be changed in preferences before using your app. Maybe that could be put in the Readme.

Thanks for a cool little app!

baztastic commented 8 years ago

Well appscript is not installed by default on my system - it's a fresh install of python3 via homebrew...

bharadwaj-raju commented 8 years ago

README updated.

bharadwaj-raju commented 8 years ago

@baztastic I've included a note in the README, but can you please provide a screenshot of the option to be disabled, in order to supplement the note?

baztastic commented 8 years ago

Yep, here's the screenshot: imgur