Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试进行快速操作,以便能够将指定的文本(例如:'print('Hello')')粘贴到我可以输入的任何位置。所以我想(使用我的 TouchBar)点击一个按钮,然后在上面打印一个文本(例如 Notes)。有没有办法做到这一点?谢谢!
我找到方法
如果您在 Quick Actions 内的 AppleScript 中编写此命令,则可以粘贴“hello”,因此您只需更改“hello”
tell application "System Events" keystroke "hello" end tell
但是您需要在系统偏好设置 > 安全和隐私 > 隐私中允许您想要的应用程序的可访问性安全性。如果应用程序未显示在列表中,您可以通过按正下方的 + 按钮手动添加它。