Applescript 远程点击

发布于 2024-09-30 19:14:23 字数 810 浏览 0 评论 0原文

我正在尝试让删除鼠标事件正常工作,并且正在尝试使用这个小脚本:

set machineB to "eppc://user:[email protected]"
tell application "Finder" of machine machineB
    say "Hello This is so stupid"
end tell
tell application "System Events" of machine machineB
    click at {100, 100}
end tell

脚本 say 很好,但抛出以下错误:

error "System Events got an error: Can’t continue click." number -1708

–1708 <reference> doesn’t understand the <commandName> message.

我做错了什么?我可以用它在我自己的机器上“点击”(至少它不会抛出错误)?


[编辑]

这与我的另一个问题此处有关。

I'm trying to get remove mouse events working and I'm attempting to use this little script:

set machineB to "eppc://user:[email protected]"
tell application "Finder" of machine machineB
    say "Hello This is so stupid"
end tell
tell application "System Events" of machine machineB
    click at {100, 100}
end tell

The script say's fine, but throws the following error:

error "System Events got an error: Can’t continue click." number -1708

–1708 <reference> doesn’t understand the <commandName> message.

What am I doing wrong? I can use it to "click" on my own machine (at least it doesn't throw errors)?


[Edit]

this is related to my other question here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆° 2024-10-07 19:14:23

你不能这样做。 Applescript 及其 tell 块在运行应用程序的 Mac 上下文中工作;您可以向家庭 Mac 上的 Finder 发送命令,因为您正在运行它,但您无法向目标 Mac 上的 Finder 实例发送命令。如果您能够从家用 Mac 运行位于目标计算机上的应用程序,则该应用程序的行为就像在家用 Mac 上运行一样。

如果您想要执行复杂的远程操作,那么我建议使用 Apple Remote Desktop 或其他类似的方法。

You can't do this. Applescript and its tell blocks work in the context of the Mac running the application; you can send commands to the Finder on your home Mac because you are running it, but you can't send commands to the instance of Finder on a target Mac. If you are able to run an application located on the target machine from your home Mac, then the application will behave as if it is being run on the home Mac.

If you are looking to do complex remote actions, then I suggest Apple Remote Desktop or another similar method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文