Skip to main content
Participant
March 28, 2023
Question

script bug place() function

  • March 28, 2023
  • 3 replies
  • 302 views

Hello, we use the place() function  (ex: myFrame.place(myFile) )
i have noticed that when i run a script that inserts ±20k images in an indesgn file with the 2022 version it took ±1-2hrs, but with 2023 it can take 3-4 days.
Logging the placing time i noticed that on the 2022 it always takes 100-300ms to place an image, while on the 2023 it starts with 100-300ms per image but it grows as more images are placed, at around 3k images it takes 1500-3000ms per image.

This topic has been closed for replies.

3 replies

Robert at ID-Tasker
Legend
March 28, 2023

First of all - doing it in one file is an overkill and asking for trouble 😞

 

Upgrading a bit @Loic.Aigon suggestion - you should split your document into smaller chunks. 

 

You'll achieve few things:

  • Quicker processing, 
  • In case InDesign crashes - you won't have to start from scratch.
  • And if you have access to multiple computers - you can do multitasking 😉 

 

As already mentioned by @brian_p_dts - you can either disable Redraw or save your document and then open it as invisible - you'll save a lot of time thanks to the fact that InDesign won't have to render / redraw screen.

 

Then, you can turn off Undo - which will save even more processing time and keep your file small.

 

And one more thing - what exactly are you doing? Because there may be a 3rd option 😉 

 

brian_p_dts
Community Expert
Community Expert
March 28, 2023

Are you opening the doc or keeping it hidden. Maybe try: app.enableRedraw = false;

Loic.Aigon
Legend
March 28, 2023

If you are processing a 20k item long js array, you may try to slice the array and process smaller chunks. I am not saying it will solve your issue but I remember that for one project, I had a very important array of items and it took hours to complete. I created a series of sub-arrays (100 items max) and could process the same items in a couple of minutes. Worth the try.