• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

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

Participant ,
Dec 30, 2022 Dec 30, 2022

Copy link to clipboard

Copied

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?

TOPICS
Scripting

Views

315

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jan 02, 2023 Jan 02, 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) 
...

Likes

Translate

Translate
Community Expert ,
Dec 31, 2022 Dec 31, 2022

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

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

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

thank you, for confirmation

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

how about a single click to a button to run your scripts? is that an option?

 

if yes, switch your actions panel to Button Mode

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

Few days back I realise that due to Quick access toolbar in PowerPoint, I extermily speedup in editing and align graphics. such functionality didn't experience in Illustrator. so I was trying to achive through script access. I don't want to open panel, observe the button label each time. insted that just remember the number to access my personal scripts

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

You can extend Adobe Illustrator with the free AutoHotkey utility. The AHK scripting language allows you to automate different applications on Windows. Including calling js scripts in Adobe. I asked an AHK expert to write a sample hotkey script call code in this thread.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 01, 2023 Jan 01, 2023

Copy link to clipboard

Copied

Windows 10

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

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

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 03, 2023 Jan 03, 2023

Copy link to clipboard

Copied

LATEST

absolutely correct, thank you so much @Sergey Osokin and @krasnovpro . you saved my many clicks

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

Your instructions indeed sound pretty promising, Alina.

 

But as well as Carlos I don't see how it would work natively in Illustrator at the moment.

 

Am I overlooking something? Can you perhaps clarify?

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 02, 2023 Jan 02, 2023

Copy link to clipboard

Copied

1.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines