cocoa - 远程计算机上带有 iTunes 的 AppleScript

标签 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 "iTunes" of machine 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

关于cocoa - 远程计算机上带有 iTunes 的 AppleScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7905329/

相关文章:

xcode - NSDistributedNotificationCenter 的可用通知

cocoa - 使用 applescript 复制最前面应用程序中的选择

macos - 如何预定义 Apple Script 常量或变量

objective-c - Swift 和 ScriptingBridge.framework

iphone - 是否有可在电子邮件、短信或其他 "share this app"消息中使用的全局 iTunes URL?

objective-c - 使 NSTextField 中不可见的字符可见

cocoa - Cocoa 有布局/几何管理吗?

api - 如何从 iTunes 搜索 API 过滤音频播客?

objective-c - 在 Retina 设备上调整图像大小

applescript - 在 Automator 中,为什么我的文件路径中的斜杠被冒号替换了?