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

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

    Hello from 2k19 :) The approach below has helped to me

    tell app "app_name"
        launch
        delay 2
    end tell
    tell app "app_name"
        do something usefull
    end tell
    

    or

    osascript -e "tell app \"app_name\"" -e "launch" -e "delay 2"-e "end tell" -e "tell app \"app_name\"" -e "do someting usefull" - e "end tell"
    
    0 讨论(0)
  • 2020-12-05 14:57

    For me, it was Apple Entitlements in Xcode.

    Specifically,

    com.apple.security.temporary-exception.apple-events

    Set it as an Array

    Then add two items to it.

    com.apple.finder

    com.apple.iTunes

    See: My applescript doesn't work any more when I upgrade my OS X to 10.9

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

    @benmarbles code seems to be missing something at the end of line 2 -- it won't even compile.

    Anyhow, I've seen the same issue with "Image Events" and I solved it with a simplified version of that script. Here's how I handle it:

    tell application "System Events" to set thePID to (unix id of process "Image Events")
    set killCMD to ("kill -9 " & thePID) as text
    do shell script killCMD with administrator privileges
    

    Replace Image Events with System Events to kill that process instead. The System Events process keeps itself alive, so there's no need to do anything to relaunch it.

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

    Apple Script may not be the issue. Assistive devices could be what is causing this.

    Enable access for assistive devices and applications by opening System Preferences > Security & Privacy > Privacy > Accessibility and check the applications you want to allow access.

    0 讨论(0)
  • 2020-12-05 15:08

    On my computer, with an uptime of 162 days, killing appleeventsd fixed the problem. I think appleeventsd and long uptimes is a bad combination.

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