Is there a way to trigger a Hot Key/Keyboard Shortcut via a Shell Script, a AppleScript or a Automator Workflow?

房东的猫 提交于 2019-12-06 20:36:22
tell application "System Events" to keystroke "l" using command down & shift down
tell application "System Events"
    key code {123, 124} using {shift down, command down} -- ⇧⌘←, ⇧⌘→
    keystroke "c" using command down -- keystroke "C" would be treated as ⇧C
end tell
delay 0.02 -- you need a small delay here before the next command
set txt to Unicode text of (the clipboard as record)

Reference of Mac key codes: lri.me/chars

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!