Applescript fails with error (-600) when launched over ssh on Mavericks

前端 未结 11 1641
孤城傲影
孤城傲影 2020-12-05 14:34

I\'ve tried searching for this, and have seen others with similar problems but don\'t seem to have found an answer anywhere....

I have an AppleScript that I am tryin

相关标签:
11条回答
  • 2020-12-05 14:41

    Arrrrgh! I don't want this to be the answer, but after trying just about everything, this now seems to be working after a restart.... My guess is that something in appleeventsd got confused (although restarting just appleeventsd on its own didn't fix anything). After a restart osascript seems to be behaving again. I'm still not convinced this is fully fixed, but it does seem to be working for the moment...

    0 讨论(0)
  • 2020-12-05 14:46

    System Events is a really finicky asshat component of OS X. Here is my method for getting around that dreaded "Application isn't running -600" error:

    set app_name to "System Events"
    set the_pid to (do shell script "ps ax | grep " & (quoted form of app_name) & "$
    if the_pid is not "" then do shell script ("kill -9 " & the_pid)
    
    tell application "System Events"
    -- activate  
    end tell
    

    I kill "System Events" with a kill -9 and then relaunch it.

    0 讨论(0)
  • 2020-12-05 14:50

    for me this happened when I tried to open gitk. Changing back to the branch I was on before, and gitk was able to open again

    0 讨论(0)
  • 2020-12-05 14:50

    I got the same error when I was unable to do GUI Scripts, but changing the System Preferences > Security & Privacy > Privacy > Accessibility settings for that specific app and adding a delay 0.5 between each line corrected it!

    0 讨论(0)
  • 2020-12-05 14:52

    I was confused by this message "for System Events" not working in newer versions of Mac OS X from the command line:

    osascript -e 'tell application "System Events" to display dialog "Build finished"'
    

    It turns out the syntax of Applescript is (changed to?) just:

    osascript -e 'display dialog "Build finished"'
    
    0 讨论(0)
  • 2020-12-05 14:56

    Application isn’t running(-600) is an operating system error.

    An operating system error is an error that occurs when AppleScript or an application requests services from the Mac OS. They are rare, and often there is nothing you can do about them in a script, other than report them.

    0 讨论(0)
提交回复
热议问题