markdown 带键盘快捷键的自定义服务

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 带键盘快捷键的自定义服务相关的知识,希望对你有一定的参考价值。

## Trigger a Service created in AutoHotkey (Windows)
As an example, trigger an Illustrator script using a keyboard shortcut in [AutoHotkey](https://autohotkey.com).
Credit to [Joonas](https://graphicdesign.stackexchange.com/questions/63439/how-to-set-keyboard-shortcut-to-run-script-in-illustrator/73189).
***
1. Create a new text file with the extension *ahk*
   Replace the path with your own.
   The `^!.` equals to `Ctrl+Alt+.` [List of modifier key symbols](https://www.autohotkey.com/docs/Hotkeys.htm#Symbols).

```
#IfWinActive, ahk_class illustrator
^!.::Run, Illustrator.exe C:\path\to\script
```

   _Remove the first line of the code, if you want to be able to trigger the script from any application_

2. Open that file in the AutoHotkey
   You should see it running in the `System Tray` under a green H icon
   You can close it from the `System Tray` via context menu

   _If you want the hotkey to always be accessible (and not just when you remember to open the ahk file), just put the file in the windows startup folder_
## Trigger a Service created in Automator (Mac)
As an example, trigger an Illustrator script using a keyboard shortcut.
Credit to [Joonas](https://graphicdesign.stackexchange.com/questions/63439/how-to-set-keyboard-shortcut-to-run-script-in-illustrator/73189).
***
1. Open **Automator**
2. Create a new **Service**
3. At the top `Service receives [no input] in [Adobe Illustrator]`
   
   _If you specify `[any application]`, you can launch the script when any window is active_

4. Add action `Get Specified Finder Items`
5. Add the file/script
6. Add action `Open Finder Items`
7. Open with `[Adobe Illustrator]`
8. Save service

   _Make sure you remember the name for this next step_

9. Go to **MacOS System Preferences > Keyboard > Shortcuts > Services > General**
10. Add a shortcut for it, ex: `alt + cmd + §`

以上是关于markdown 带键盘快捷键的自定义服务的主要内容,如果未能解决你的问题,请参考以下文章

如何重新定义内置键盘快捷键的行为?

markdown Ubuntu - 键盘快捷键

markdown Visual Studio键盘快捷键

markdown Windows键盘快捷键

markdown Windows键盘快捷键

markdown Windows键盘快捷键