Skip to main content
Participant
February 7, 2023
Question

Adobe script caused the file to run slow?

  • February 7, 2023
  • 3 replies
  • 894 views

Hi,

 

Is it possible for adobe to run slow if it has multiple script? Here are two examples of the script (thanks to try67 for helping out) below:

 

if (/spen/i.test(this.getField("PlaceRow1").value) && /sit/i.test(this.getField("PlaceRow2").value)){event.value="320 miles"}

 

if(this.getField("PlaceRow19").value.match(/yak/i) && this.getField("PlaceRow20").value.match(/hub/i) && this.getField("PlaceRow21").value.match(/cea/i)){event.value="62"}

 

There are a total of  362 differenct script each field, and there are 23 fields. Total of 8,326 different scripts and that's only half way done.

 

I've noticed that everytime I change/type anything in the field (PlaceRow#), an hour glass shows up with an icon looking like a keyboard and it takes between 2-3 second for it to respond.

 

Is there anyway around this if it caused by multiple scripts? 

 

Note: I have not issue with any other adobe files.

 

Thank you

 

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
February 9, 2023

Yes, those calculations are likely to cause a delay. To avoid it you would need to adjust your code to check which field triggered the calculation (by looking at event.source.name) and then deciding which fields to update, based on that.

Bernd Alheit
Community Expert
Community Expert
February 9, 2023

2-3 seconds for all calculations is a good value.

Participant
February 9, 2023

Even though it was running smoothly prior to having that much script? When it was below certain number there wasn't any lag at all or does not freezes for 2-3 sec.

 

I mean if there really isn't any way to fix it, I don't much of a choice. It is just that i'm only half way done.... I hope it doesn't get any worst.

Bernd Alheit
Community Expert
Community Expert
February 8, 2023

Does you use the scripts at calculation?

Participant
February 8, 2023

Yes, I have the script entered under "Calculated" tab, in -custom calculation script-, please see image below.