Closed nkprince007 closed 7 years ago
Cause identified: System Events application located at /System/Library/CoreServices/System Events.app
might not be running sometimes.
How do we start it?
Maybe we need to change our requirements. py-appscript looks promising. Since, AppleScript comes with macOS and the cited package is just a wrapper to NSAppleScript
originally written in Objective-C. If we proceed this way, we would need to write an AppleScript to get our job done via System Events
, inherently invoking the cited process, if it isn't already running.
Set wallpaper:
tell application "System Events"
set picture of every desktop to "/Library/Desktop Pictures/Abstract.jpg"
end tell
Get Wallpaper:
tell application "System Events"
get picture of every desktop
end tell
This applescript always seems to work. I even tried it by deliberately killing System Events.app
.
:heart: AppleScript, it's quite so readable. Makes things a lot easier.
I think we could just dump even the use of any requirements for OSX.
The AppleScript could even be invoked even from command line via osascript
tool.
@abhsag24 @nemaniarjun
Need your opinions on this one. I prefer to use the osascript
tool via subprocess
and Popen
rather than adding appscipt
or py-appscript
as a dependency.
I agree, If we can remove dependencies AND improve functionality, then why not? :+1:
Bug report: http://pastebin.com/ftCYW3r9
Probable cause: Updated
osascript
/ Outdated requirements.