Cocoa 在远程计算机上使用iTunes编写AppleScript

Cocoa 在远程计算机上使用iTunes编写AppleScript,cocoa,applescript,itunes,Cocoa,Applescript,Itunes,我在XCode中有一个Cocoa AppleScript项目,我试图在本地网络计算机上向iTunes发送一些命令。出于某种原因,这是可行的: tell application "iTunes" of machine "eppc://user:pass@computer.local" playpause end tell 但这并不是: set remoteMachine to "eppc://user:pass@computer.local" tell application "iTun

我在XCode中有一个Cocoa AppleScript项目,我试图在本地网络计算机上向iTunes发送一些命令。出于某种原因,这是可行的:

tell application "iTunes" of machine "eppc://user:pass@computer.local"
    playpause
end tell
但这并不是:

set remoteMachine to "eppc://user:pass@computer.local"
tell application "iTunes" of machine remoteMachine
    playpause
end tell

我收到错误“找不到远程计算机”。有什么想法吗?

尝试添加一个名为的限定符:

set remoteMachine to "eppc://user:pass@computer.local"
tell application "iTunes" of machine named remoteMachine
    playpause
end tell

好吧,我想出来了,或者至少有一种方法。您可以在远程计算机上指定应用程序本身,如:

set theRemoteApp to application "eppc://user:pass@computer.local/iTunes"
using terms from application "iTunes"
    tell theRemoteApp
        playpause
    end tell
end using terms from