Support Forum

shortcuts for macros

User
LayoutEditorFull
Monday 16th December 2019
I wrote a few micro scripts and added them to the layeredit toolbar,but how do I set up shortcut for them。 I try using "layout->setShortcut("C:/Program Files/Layout/1.layout","v"); but false
Jürgen
LayoutEditorFull
Monday 16th December 2019
please add the 'shortcut' line to the header of the macro and add the macro to the menu: ``` #!/usr/bin/layout #name=menu_name of the macro #help=help-text #shortcut=Shift+F ``` Shortcuts are always related to a menu entry. So the shortcut will only get effective when the macro is listed in the menu. Do to that, you need to add your macro path to the setup/macro/macro_directories. The menu tree were the macro is added is identical with the files tree. So if you place it at myPath/layout/Utilities/my_macro.layout and add myPath to the macro directories in the setup, it will be displayed in the utilities menu of the layout window.