AppleScript错误-2710

时间:2016-12-02 20:45:22

标签: applescript

以下代码在AppleScript中引发错误。我得到error "iTerm got an error: Can’t make class «class Ptrm»." number -2710 from «class Ptrm» to class。可能导致它的任何建议?我对AppleScript完全不熟悉,但是我把这个可能已经过时的脚本交给我了,需要它运行才能在iTerm中产生以下5个操作。欢迎所有见解!感谢

tell application "iTerm"
set t to (make new «class Ptrm»)
tell t
    activate «class Cssn»
    «event ITRMLNCH» given «class Pssn»:"Default Session"
    tell the last «class Pssn»
        «event ITRMWrte» given «class iTxt»:"vagrant ssh"
        «event ITRMWrte» given «class iTxt»:"cd /vagrant"
        «event ITRMWrte» given «class iTxt»:"./devsettings.sh scripts/runserver.py"
        delay 1
    end tell
    «event ITRMLNCH» given «class Pssn»:"Default Session"
    tell the last «class Pssn»
        «event ITRMWrte» given «class iTxt»:"vagrant ssh"
        «event ITRMWrte» given «class iTxt»:"cd /vagrant"
        «event ITRMWrte» given «class iTxt»:"./localsettings.sh ./scripts/runcelery.py worker -c 10 -A plug.tasks -Q celery,pushq"
        delay 1
    end tell
    «event ITRMLNCH» given «class Pssn»:"Default Session"
    tell the last «class Pssn»
        «event ITRMWrte» given «class iTxt»:"vagrant ssh"
        «event ITRMWrte» given «class iTxt»:"cd /vagrant/messaging"
        «event ITRMWrte» given «class iTxt»:"python2.7 directoryServer.py"
        delay 1
    end tell
    «event ITRMLNCH» given «class Pssn»:"Default Session"
    tell the last «class Pssn»
        «event ITRMWrte» given «class iTxt»:"vagrant ssh"
        «event ITRMWrte» given «class iTxt»:"cd /vagrant/messaging"
        «event ITRMWrte» given «class iTxt»:"python2.7 iHttp.py"
        delay 1
    end tell
    «event ITRMLNCH» given «class Pssn»:"Default Session"
    tell the last «class Pssn»
        «event ITRMWrte» given «class iTxt»:"vagrant ssh"
        «event ITRMWrte» given «class iTxt»:"cd /vagrant/messaging/src"
        «event ITRMWrte» given «class iTxt»:"go run wsServer.go"
    end tell
end tell

1 个答案:

答案 0 :(得分:-1)

您是否尝试过重置计算机的库? 在iTerm中输入以下命令,然后重新编译脚本,看看是否仍然出现此错误。

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user