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

script bug place() function

New Here ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

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.

TOPICS
Bug , Scripting

Views

186

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
People's Champ ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

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.

Votes

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 ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

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

Votes

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 ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

LATEST

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 😉 

 

Votes

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