Shortcuts help to improve workflow tremendously, unfortunately, as for, 2021 ability to add shortcuts to scripts in Adobe Illustrator is somewhat limited.
Illustrators default way:
You are in fact, adding shortcut to action, then calling that action. Shortcuts are limited to function keys(F1, F2..)
- Open the action panel Windows > Actions
- Create a new action by clicking on folded paper icon at the actions panel’s bottom . Click on Function key dropdown to assign it a shortcut key.
- Click on record (The circle icon at the bottom of the panel).
- Click on the actions panels menu icon (3 horizontal lines, hamburger,)(located at the top right corner of the panel), click on “Insert Menu Item…” (If you forgot to click on record this option will be greyed out)
- Type part of script name and press TAB – or- Click on the script’s menu item. File > Scripts > myScript.jsx then click OK.
- Click on the square stop recording icon(bottom of the panel) to stop action recording
- You have added shortcut!