开发者

send key code to field

i want to simulate the pressing of the enter key using py-appscript

i already found this, but it seems to only output th开发者_开发百科e newline Translate Applescrip [key code 125 using command down] to appscript

right now i want to press the enter key after the value has been set.

Example, after entering the IP hit enter key.

or send a keycode to the field itself.


app('System Events').key_code(76). (Or key_code(36) or keystroke('\r') if you meant ↩ instead of ⌤.)

keystroke and key_code don't ignore keys actually held down by the user, so you might need to add a delay if you're using a shortcut with modifier keys used to run the script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜