翻译Applescrip [键code 125使用的命令下] appscript [英] Translate Applescrip [key code 125 using command down] to appscript

查看:537
本文介绍了翻译Applescrip [键code 125使用的命令下] appscript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以下的AppleScript翻译成appscript:

how to translate the following Applescript to appscript:

tell application "System Events"
    key code 0 using command down
end tell

我想执行的命令+ A般的捷径,即选择所有文本。

I want to perform "Command + A"-like short cut, i.e., select all texts.

推荐答案

看这是安装为Appscript的一部分应用ASTranslate。它转换的AppleScript到Appscript为Python或Ruby。要知道它只是陷阱苹果事件,因此不会转化AppleScript的结构如循环等。这是非常容易使用。刚刚过去的AppleScript的一个窗格,打CMD-R,它会生成翻译Appscript + Python的code。为了您的例子是

Look at the application ASTranslate which was installed as part of Appscript. It translates Applescript to Appscript for Python or Ruby. Be aware it just traps Apple Events and thus won't translate Applescript structures like loops or the like. It's very easy to use. Just past your Applescript in one pane, hit cmd-R, and it'll generate the translated Appscript + Python code. For your example it is

应用程序(u'System事件')。KEY_ code(0,使用= k.command_down)

app(u'System Events').key_code(0, using=k.command_down)

虽然偶尔你就会发现这是行不通的,一般ASTranslate完全正确是使用Appscript的必备工具。

While occasionally you'll find something that won't work quite right in general ASTranslate is an essential tool for using Appscript.

这篇关于翻译Applescrip [键code 125使用的命令下] appscript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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