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

[AS] Script runs slower and slower

Guest
Mar 16, 2009 Mar 16, 2009
I am working on some scripts which interacts a lot with each page of a long InDesign document - basically it does a lot of searching, and does stuff depending on what it finds.

For the first couple of minutes, its really fast, but then gets slower and slower.

Is there any way to make InDesign catch its breath? Like pausing the script?
TOPICS
Scripting
3.8K
Translate
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
LEGEND ,
Mar 19, 2009 Mar 19, 2009
Thomas_Silkjaer@adobeforums.com wrote:
> but since my script is doing a lot of selections etc...

If you are using selections in your script, chances are, there's better
ways to accomplish what you're doing...

--
Harbs
http://www.in-tools.com
Translate
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
Guest
Mar 19, 2009 Mar 19, 2009
But since my script doesn't handle all errors that well, ill just run it without redraw and flush the undos by saving once in a while.
Translate
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 ,
Mar 19, 2009 Mar 19, 2009
Hi Thomas,

Ah, if your script is doing lots of selections, that's probably another performance bottleneck. Most of the time, you can work without selecting objects. What are you trying to do that requires selection?

Thanks,

Ole
Translate
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
Guest
Mar 19, 2009 Mar 19, 2009
I do the selections, to search using "find grep" within the selections. I suppose i could pass a text style range instead?

My script depends a lot wether things are located in a text style range on the current page or not.

But the time the script takes now is OK for this purpose. Turning redraw off almost cut the time in two.
Translate
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 ,
Mar 19, 2009 Mar 19, 2009
Hi Thomas,

You'd probably want to pass a text object, not a text style range.

Thanks,

Ole
Translate
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
Guest
Mar 19, 2009 Mar 19, 2009
Ill experiment a little with it. I create a lot of object references to text, select the referenced text and search it using grep find. I should probably just skip the selection part, don't know why i did it :)

Thanks.
Translate
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 ,
Mar 19, 2009 Mar 19, 2009
Hi Thomas,

Should be fairly easy to make the change--you can just tell the text object reference to find grep.:-)

Thanks,

Ole
Translate
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