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

前端 未结 11 1653
孤城傲影
孤城傲影 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: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.

提交回复
热议问题