Applescript 不接受 arRsync sdef 命令?
我正在使用名为“arRsync”的开源 GUI 前端进行 rsync。它工作得很好,但没有办法自动化它。
我想做的是使用 Applescript 使用以下简单脚本运行预设(您在应用程序中定义):
tell application "arRsync" to runPreset "presetTest1"
问题是 Applescript 认为“runPreset”是一个变量,而不是命令。我还尝试了上述的告诉/结束告诉变体,没有骰子。 “runPreset”命令是 arRsync.sdef 的一部分
您可以在此处找到 arRsync 项目
我尝试打开应用程序内的两个 Info.plist 文件并勾选“可编写脚本”框(或者对于那些没有属性列表编辑器的人将其设置为“true”),但我仍然陷入困境。
当涉及到 Cocoa 时,我是一个脚本新手:p 帮助将不胜感激
I'm using the opensource GUI frontend for rsync called "arRsync". It works great, but there's no way to automate it.
What I'm trying to do is use Applescript to run a preset (which you define in the Application) using the following simple script:
tell application "arRsync" to runPreset "presetTest1"
The problem is Applescript thinks "runPreset" is a variable, not a command. I've also tried a tell/end-tell variation of the above, no dice. The 'runPreset' command is part of arRsync.sdef
You can find the arRsync project here
I've tried opening up both Info.plist files inside the app and ticking the 'Scriptable' box (or setting it to 'true' for those of you without Property List Editor) but I'm still stuck.
I'm a scripting noob when it comes to Cocoa :p help would be greatly appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
arRsync 二进制文件缺少脚本字典。从源代码构建,首先进行以下更改:
修复项目的脚本字典 arRsync.sdef。
runPreset
命令的代码中的一个字母太少 (命令代码必须是两个 FourCC,或八个字符长)。在runPreset
的code属性中添加一个字符;几乎任何角色都可以。如果需要,可以通过用包含替换标准和文本套件来缩短和简化该文件。备份原始文件并创建一个新的arRsync.sdef,其中包含:或者,您可以将
runPreset
命令元素替换为上面的命令元素。这应该会生成 arRsync 的可编写脚本的版本。正如您已经发现的,您可能还需要使用目标 SDK。
The arRsync binary is missing a scripting dictionary. Build from source, first making the following changes:
Fix the project's script dictionary, arRsync.sdef. The code for the
runPreset
command has one letter too few (command codes must be two FourCCs, or eight characters, long). Add a character torunPreset
's code attribute; just about any character will work. If you want, the file can be shortened and simplified by replacing the Standard and Text suites with an include. Back up the orignal file and make a new arRsync.sdef containing:Alternatively, you could just replace the
runPreset
command element with the one from above.That should produce a scriptable version of arRsync. As you've already figured out, you also might need to play with the target SDK.