在 Mavericks 上通过 ssh 启动时,Applescript 失败并显示错误 (-600) [英] Applescript fails with error (-600) when launched over ssh on Mavericks

查看:24
本文介绍了在 Mavericks 上通过 ssh 启动时,Applescript 失败并显示错误 (-600)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过搜索这个,也看到其他人有类似的问题,但似乎没有在任何地方找到答案......

I've tried searching for this, and have seen others with similar problems but don't seem to have found an answer anywhere....

我有一个 AppleScript,我试图通过 ssh 运行它,以便我可以远程控制我的 mac.这以前在 OSX 10.8 中有效,但自从升级到 10.9 后似乎不再有效.

I have an AppleScript that I am trying to run over ssh so that I can remotely control my mac. This has worked previously with OSX 10.8 but no longer seems to work since upgrading to 10.9.

我正在执行的命令是:

ssh <user>@mymac.local "osascript -e 'tell application \"iTunes\" to play'"

  • 我已经设置了 RSA 密钥,所以 ssh 会话可以正确打开
  • 我以 Mac 当前登录并在其下运行的用户身份进行连接
  • 启动脚本时,iTunes 正在与该用户一起在 Mac 上运行
  • 脚本失败,返回:

    execution error: iTunes got an error: Application isn’t running. (-600)
    

    同样地,我之前使用的一些其他脚本现在似乎也在 10.9 上被破坏并出现相同的错误,所以这似乎与它通过 ssh 运行的事实有关,而不是 iTunes 的问题或特定的应用程序.

    Similarly, a number of other scripts that I had previously been using also seem to now be broken on 10.9 with the same error, so this seems to be related to the fact that it's running over ssh, rather than an issue with iTunes or a specific application.

    我尝试将 Applescripts 打包为应用程序,将它们保存在远程 Mac 上,然后从 ssh 会话中打开它们,但这也失败了:

    I've tried packaging the applescripts as applications, saving them on the remote Mac, and then opening them from within an ssh session, but this also fails:

    ssh <user>@mymac.local
    open "~/Desktop/Play Music.app"
    

    (其中Play Music.app")是作为应用程序导出的苹果脚本).

    (Where 'Play Music.app') is an applescript exported as an app).

    这在ssh会话中不会报错,但是远程mac上出现applescript对话框:

    This does not report an error within the ssh session, but an applescript dialog appears on the remote mac:

    我的 Mac 上也有几个使用 crontab 调度的脚本,这些脚本在升级后也失败了.

    I also have several scripts that were scheduled with crontab on my Mac, and these are also failing since upgrading.

    我认为这是作为 Mavericks 一部分的某种安全更改,但我似乎无法找到使其再次运行的方法.有没有人对此有任何解决方案?

    I assume this is some sort of security change as part of Mavericks, but I can't seem to find a way to make it work again. Does anyone have any solutions to this?

    推荐答案

    Application is not running(-600) 是一个 操作系统错误.

    操作系统错误是在 AppleScript 或应用程序从 Mac OS 请求服务.它们很少见,而且通常在脚本中你无能为力,除了举报他们.

    An operating system error is an error that occurs when AppleScript or an application requests services from the Mac OS. They are rare, and often there is nothing you can do about them in a script, other than report them.

    这篇关于在 Mavericks 上通过 ssh 启动时,Applescript 失败并显示错误 (-600)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆