Skip to main content
j.khakase
Inspiring
December 31, 2022
Answered

Is there a way to set custom shortcut key to specific Illustrator script?

  • December 31, 2022
  • 5 replies
  • 9503 views

Is there a way to set custom shortcut key to specific Illustrator script?

I want to run a script which is listed in my script collection with Alt+1 key

is this possible?

Correct answer krasnovpro

You can use autohotkey. I prefer version 2.

 

Download autohotkey, unzip, create near AutoHotkey64.exe file AutoHotkey64.ahk with this code:

 

#Requires AutoHotkey v2.0
#SingleInstance Force

#HotIf WinActive("ahk_exe Illustrator.exe")
  !1:: aiScript("script1")
  !2:: aiScript("script2")

aiScript(name) {
  static app := "c:\Program Files\Adobe\Adobe Illustrator 2023\Support Files\Contents\Windows\Illustrator.exe"
       , path := "c:\Users\user\Documents\aiScripts"
  if FileExist(script := name) 
  or FileExist(script := path "\" name) 
  or FileExist(script := path "\" name ".jsx") 
  or FileExist(script := path "\" name ".js") 
    Run('"' app '" "' script '"',, "max")
}

 

run AutoHotkey64.exe

 

In Illustrator:

Alt-1 will run c:\Users\user\Documents\aiScripts\script1.jsx

Alt-2 — c:\Users\user\Documents\aiScripts\script2.jsx

 

5 replies

Colin Flashman
Community Expert
Community Expert
April 23, 2025

If you are using an Elgato Streamdeck after March 2025 it is possible to use the "action" technique but instead of assigning a hotkey, you can now assign an action directly into the Elgato Streamdeck as a button.

EDIT - ONLY FOR PHOTOSHOP. Realised this is an Illustrator question. Oops.

Here is an example that I added to one of my Streamdeck button screens so that I could quickly run a photoshop action after editing a file in acrobat (acrobat would launch photoshop and I could run the script using my Elgato Streamdeck button).

Unsure if this also works with the Logitech MX Creative Console - if it does, I'll edit this post once I'm at home (currently at the office)

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!
Known Participant
April 23, 2025

Thanks for taking the time on that! I need something that doesn't require any additional hardware or software, though, since I need to provide it to other team members at my company.

Known Participant
April 23, 2025

Ugh, where are the Edit and Delete functions in this forum?

 

Come on, that's just pathetic.

New Participant
August 22, 2024

You can use Actions to create shortcut for your script.

Simply from Action window
> New Action
> Name it > set your shortcut > then choose your script
> from the 3 Dashes on the top right of the Actions menu
> Insert Menu Item
> Type the name of your script (same as the naming of the jsx file)
> Find (by starting typing a little part of it it and might work, be sure it finds your script not other command)
> Ok
> Congrats 🥳

if you forget to set the shortcut when creating your action, you can do it like this:
> Select your new Action in the Action window
> go the 3 Dashes top right
> Action Options
> set the shortcut you wanted.
> Congrats 🥳

 

Inspiring
April 22, 2025

Unbelievable. Thanks for pointing out this defect, and a workaround.

AlinaMiler
New Participant
January 2, 2023

Yes, you can set custom shortcut keys for specific Illustrator scripts. Here's how:

  1. Open Illustrator and go to the "File" menu.
  2. Select "Scripts" and then "Other Script..." from the dropdown menu.
  3. Find the script you want to set a shortcut key for and select it.
  4. Go to the "Edit" menu and choose "Keyboard Shortcuts..."
  5. In the "Keyboard Shortcuts" window, click on the "Scripts" folder in the list on the left.
  6. Scroll through the list of scripts on the right until you find the one you want to set a shortcut key for.
  7. Click on the script name, then click in the "Shortcut" field.
  8. Press the keys you want to use as the shortcut.
  9. Click "Accept" to save your changes.
    You can also use the "Shortcuts For" dropdown menu at the top of the "Keyboard Shortcuts" window to select a different set of shortcuts to customize. This can be useful if you want to create a separate set of shortcuts for different tasks or projects.
CarlosCanto
Community Expert
Community Expert
January 2, 2023

Hi @AlinaMiler, are you using a third party software? The instructions don't seem to be native to Illustrator

Sergey Osokin
Inspiring
January 1, 2023

What operating system do you use: Windows, Mac OS?

j.khakase
j.khakaseAuthor
Inspiring
January 2, 2023

Windows 10

krasnovpro
krasnovproCorrect answer
Participating Frequently
January 2, 2023

You can use autohotkey. I prefer version 2.

 

Download autohotkey, unzip, create near AutoHotkey64.exe file AutoHotkey64.ahk with this code:

 

#Requires AutoHotkey v2.0
#SingleInstance Force

#HotIf WinActive("ahk_exe Illustrator.exe")
  !1:: aiScript("script1")
  !2:: aiScript("script2")

aiScript(name) {
  static app := "c:\Program Files\Adobe\Adobe Illustrator 2023\Support Files\Contents\Windows\Illustrator.exe"
       , path := "c:\Users\user\Documents\aiScripts"
  if FileExist(script := name) 
  or FileExist(script := path "\" name) 
  or FileExist(script := path "\" name ".jsx") 
  or FileExist(script := path "\" name ".js") 
    Run('"' app '" "' script '"',, "max")
}

 

run AutoHotkey64.exe

 

In Illustrator:

Alt-1 will run c:\Users\user\Documents\aiScripts\script1.jsx

Alt-2 — c:\Users\user\Documents\aiScripts\script2.jsx

 

Monika Gause
Community Expert
Community Expert
December 31, 2022

If the script is installed and you can call it from File > Scripts, then you can call it in an action. And then set a shortcut to that action. Do you know how to create actions?

j.khakase
j.khakaseAuthor
Inspiring
January 2, 2023

Yes, I know how to create actions and assign it shortcuts. but there is limitation to assign it. We can't assign the shortcut which I am expecting Alt + 1

CarlosCanto
Community Expert
Community Expert
January 2, 2023

no, unfortunately only F keys can be assigned to Actions, which is the only way to run scripts via shorcut key.