2011-10-26 195 views
2

我在XCode中有一個Cocoa-AppleScript項目,我試圖在本地網絡計算機上向iTunes發送一些命令。出於某種原因,這個工程:AppleScript與遠程計算機上的iTunes

tell application "iTunes" of machine "eppc://user:[email protected]" 
    playpause 
end tell 

但這並不:「找不到遠程機器」

set remoteMachine to "eppc://user:[email protected]" 
tell application "iTunes" of machine remoteMachine 
    playpause 
end tell 

我得到的錯誤有任何想法嗎?

回答

1

好,我想通了,還是做它至少一種方式。您可以在遠程計算機上指定應用程序本身,如:

set theRemoteApp to application "eppc://user:[email protected]/iTunes" 
using terms from application "iTunes" 
    tell theRemoteApp 
     playpause 
    end tell 
end using terms from 
0

嘗試添加named預選賽:

set remoteMachine to "eppc://user:[email protected]" 
tell application "iTunes" of machine named remoteMachine 
    playpause 
end tell 
+0

不幸的是,這並沒有奏效。任何其他想法? – Jesse