有没有通过Shell脚本,一个的AppleScript或Automator的工作流程触发热键/快捷键的方法吗? [英] Is there a way to trigger a Hot Key/Keyboard Shortcut via a Shell Script, a AppleScript or a Automator Workflow?

查看:1107
本文介绍了有没有通过Shell脚本,一个的AppleScript或Automator的工作流程触发热键/快捷键的方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个狂热的键盘大师的用户,我需要一个解决方法触发键盘快捷键像⌘⇧L(外部,没有键盘大师)。因此,我认为一个bash脚本将能够做这样的事的。一个AppleScript或Automator的工作流程就足够了。我任何人都可以帮助我,这将是巨大的。


您不必阅读,但在这里就是为什么我要去做我想做的事:

我有一个相同的字符串分配给不同的降价宏,我用一个字符串,而不是热键,因为它更难忘的我,因为我的大脑已经充满了这么多的应用程序快捷方式。缺点是键盘大师不会删除该字符串的按键。我可以在程序中执行多个操作来删除它们,但增加这些行动对每一个宏是乏味和次优的。


解决方案

 告诉应用程序系统事件到击键L使用命令向下放大器;降档

I'm an avid Keyboard Maestro user and I need a workaround for triggering a keyboard shortcut like ⌘⇧L (externally, without Keyboard Maestro). So I thought a bash script would be capable of doing such a thing. An AppleScript or an Automator workflow would be sufficient, too. I anybody could help me this would be great.


You don't have to read this, but here's why I want to do what I want to do:

I have a the same string assigned to various Markdown macros, I use a string instead of Hotkeys because it's much more memorable for me since my brain already is filled with so many application shortcuts. The disadvantage is that Keyboard Maestro won't delete the keystrokes of the string. I can perform several actions within the program to delete them but adding these actions for each and every macro is tedious and suboptimal.

解决方案

tell application "System Events" to keystroke "l" using command down & shift down

这篇关于有没有通过Shell脚本,一个的AppleScript或Automator的工作流程触发热键/快捷键的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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