Is it possible to set a custom keyboard shortcut to a script? Custom tool scripts show up in the keyboard shortcut setup, but not scripts.
Any ideas how to accomplish this?
Custom keyboard shortcut to launch a script?
Moderators: Víctor Paredes, Belgarath, slowtiger
-
- Posts: 107
- Joined: Mon Jan 14, 2013 3:18 pm
- synthsin75
- Posts: 9935
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Custom keyboard shortcut to launch a script?
Menu scripts are the same as button scripts, so if you add them to the toolbar, you can give them a shortcut.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
-
- Posts: 107
- Joined: Mon Jan 14, 2013 3:18 pm
Re: Custom keyboard shortcut to launch a script?
Ah, button scripts. I started scripting today... makes sense! Thanks again!!! I'll give my script a button.
- synthsin75
- Posts: 9935
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Custom keyboard shortcut to launch a script?
You're welcome, and welcome to AS scripting.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
-
- Posts: 107
- Joined: Mon Jan 14, 2013 3:18 pm
Re: Custom keyboard shortcut to launch a script?
Thank you
I quickly wanted to clarify two things, I'm not quite sure about these concepts yet?
-by making it a button, do you mean creating a tool that has a button bar at the top? It's not possible to create a tool-looking button that would activate a script directly but it has to be via "Select tool -> press button at the appearing toolbar"?
-which function separates a script menu script and a tool? I could find a mention which function AS looks for in the script to determine whether it's a tool or a script menu script? What is the very basic code that tells AS to make a script a tool?
I quickly wanted to clarify two things, I'm not quite sure about these concepts yet?
-by making it a button, do you mean creating a tool that has a button bar at the top? It's not possible to create a tool-looking button that would activate a script directly but it has to be via "Select tool -> press button at the appearing toolbar"?
-which function separates a script menu script and a tool? I could find a mention which function AS looks for in the script to determine whether it's a tool or a script menu script? What is the very basic code that tells AS to make a script a tool?
- synthsin75
- Posts: 9935
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Custom keyboard shortcut to launch a script?
No, not a tool option button. In the toolbar are two types of scripts, tools and buttons. Buttons do not remain active when pressed, like the Insert Text button. Buttons use the exact same syntax as menu scripts, e.g. function someScript:Run(moho). To get the button behavior, you'll need to edit the _tool_list.txt in the tools folder (preferably in your custom content folder). You'll see that the tool_list already has some buttons setup, so just follow that example with your own.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
-
- Posts: 107
- Joined: Mon Jan 14, 2013 3:18 pm
Re: Custom keyboard shortcut to launch a script?
Ah, thank you so much!!!synthsin75 wrote:No, not a tool option button. In the toolbar are two types of scripts, tools and buttons. Buttons do not remain active when pressed, like the Insert Text button. Buttons use the exact same syntax as menu scripts, e.g. function someScript:Run(moho). To get the button behavior, you'll need to edit the _tool_list.txt in the tools folder (preferably in your custom content folder). You'll see that the tool_list already has some buttons setup, so just follow that example with your own.