Skip to main content
Known Participant
December 19, 2023
Question

How to speed up the jsx execution in Illustrator?

  • December 19, 2023
  • 2 replies
  • 571 views

I have a jsx script that inserts lots of svg into Illustrator, the task took about seven seconds. It's too slow, I want to speed up my script, so any advice? prevent UI updating while execution or jsx to C++ code?

This topic has been closed for replies.

2 replies

CarlosCanto
Community Expert
Community Expert
December 19, 2023

you're on the right track, hide tools, control bar and panels by pressing TAB key. Or go full screen (F).

 

Switching to Outline View (Ctrl+Y) also speeds up screen redrawing.

Known Participant
December 20, 2023

@CarlosCanto   How to switch to Outline View by jsx? thks a lot.

Sergey Osokin
Inspiring
December 20, 2023

There is no specific command for outline view. The following command works as a toggle between Preview and Outline modes. If you were in Preview mode in the UI when you ran the script, the first execution of this command will definitely switch to Outline. For Adobe Illustrator CS6+

 

app.executeMenuCommand('preview');

 

 

m1b
Community Expert
Community Expert
December 19, 2023

Hi @LoveYou阿逗逼6666, the less you interact with the DOM the faster things will be, generally. So you can try to do more of your code with vanilla ExtendScript objects. Try to avoid anything that "selects" objects, uses menus or actions, or causes window redraw. Otherwise I don't have specific advice without seeing your code.

 

And yes: if you use C++ code via the SDK that will speed things up a lot.

- Mark

Known Participant
December 20, 2023

Is there any way to do jsx script without Illustrator UI?