Try running the attached script in photoshop. A small dialog with a run button will appear. Click run and a complex template editor dialog will open. Cancel the template editor dialog. Repeat this process 5-6 times. It takes longer each time for the dialog to open. There is some timing code in the script that reports to the ESTK.
I think this is a closure issue, caused by the inner functions used, but I am not sure. Any feedback on how to prevent this would be greatly appreciated.
Also, any idea what $.debugDialog does? I found it at the start of ImportCamera_BR.jsx.
Potential script closure issue
Potential script closure issue
Is this the full code? I can't get it to run at all. I get an error on line 33 'Ditto is undefined'.
I commented out that line and got the same error at line 44
I commented out that line and got the same error at line 44
Potential script closure issue
Mike Hale wrote:Is this the full code? I can't get it to run at all. I get an error on line 33 'Ditto is undefined'.
I commented out that line and got the same error at line 44
Hi Mike
It runs on my two PC's by itself in photoshop CS2.
You could try adding the line
Ditto = {};
before line 33. It works both ways for me.
I commented out that line and got the same error at line 44
Hi Mike
It runs on my two PC's by itself in photoshop CS2.
You could try adding the line
Ditto = {};
before line 33. It works both ways for me.
Potential script closure issue
That helped, I now get the first dialog. But if I click on run it gets stuck in a loop. I get an error 'Ditto.ddhelp is not a function'. I have to cancel the run dialog to exit.
I am running this using ESTK and CS2, but it does the same if I run it from the CS2 script menu.
I am running this using ESTK and CS2, but it does the same if I run it from the CS2 script menu.
Potential script closure issue
Mike Hale wrote:That helped, I now get the first dialog. But if I click on run it gets stuck in a loop. I get an error 'Ditto.ddhelp is not a function'. I have to cancel the run dialog to exit.
I am running this using ESTK and CS2, but it does the same if I run it from the CS2 script menu.
I thought I had gotten rid of the ddHelp stuff. For some reason it is still working on my machine.
I have commented out the helptips and reattached the file.
Thanks very much for the feedback to help with this.
I am running this using ESTK and CS2, but it does the same if I run it from the CS2 script menu.
I thought I had gotten rid of the ddHelp stuff. For some reason it is still working on my machine.
I have commented out the helptips and reattached the file.
Thanks very much for the feedback to help with this.
Potential script closure issue
Rory,
I'm afraid that I will not be able to help you much with this. Other than to comfrim that it does take longer on my machine as well. Each loop seems to take about 45 seconds longer on my machine. Although it does vary and sometimes there is little increase.
I did several runs, some as long as 20 loops. I ploted the timing results in excel. It is just a guess, but it might be JS garbage collection because different parts take more time in each loop.
For example, in one run Dropdown lists timing was 0 twice, 16 9 times, 32 3 times and 64 once. The other sections where much the same, generally taking longer each loop but some times faster than the previous loop.
I can follow your code, but my skill set in not strong enough to see why it takes longer. I did move the fontlist code to the top so it is only run once and that seems to help level out the 'General tab' section.
Hope this helps and hope you find the problem
Mike
I'm afraid that I will not be able to help you much with this. Other than to comfrim that it does take longer on my machine as well. Each loop seems to take about 45 seconds longer on my machine. Although it does vary and sometimes there is little increase.
I did several runs, some as long as 20 loops. I ploted the timing results in excel. It is just a guess, but it might be JS garbage collection because different parts take more time in each loop.
For example, in one run Dropdown lists timing was 0 twice, 16 9 times, 32 3 times and 64 once. The other sections where much the same, generally taking longer each loop but some times faster than the previous loop.
I can follow your code, but my skill set in not strong enough to see why it takes longer. I did move the fontlist code to the top so it is only run once and that seems to help level out the 'General tab' section.
Hope this helps and hope you find the problem
Mike
Potential script closure issue
One other thought
On my system there is a very large gap between show() and when the dialog appears on the screen. That may be due to your using autolayout. Here the first loop is generally done in less than a second but the dialog does not display for almost 20.
It could be that even though Adobe recommends using autolayout it, like other JS parts new to Photoshop, is not ready for printe time.
You might try building the dialog without autolayout. It could be that if the dialog showed in 1 second the first loop, you wouldn't mind that it taking 3 seconds by the 5 or 6 loop. But with it already taking too long in the first loop, any increase is very noticeable.
On my system there is a very large gap between show() and when the dialog appears on the screen. That may be due to your using autolayout. Here the first loop is generally done in less than a second but the dialog does not display for almost 20.
It could be that even though Adobe recommends using autolayout it, like other JS parts new to Photoshop, is not ready for printe time.
You might try building the dialog without autolayout. It could be that if the dialog showed in 1 second the first loop, you wouldn't mind that it taking 3 seconds by the 5 or 6 loop. But with it already taking too long in the first loop, any increase is very noticeable.
Potential script closure issue
Mike
Thanks very much for taking the time to try this out and confirm the performance degradation. I'll keep plugging away and xbytor said he would take a look.
Have a very Merry Christmas.
Thanks very much for taking the time to try this out and confirm the performance degradation. I'll keep plugging away and xbytor said he would take a look.
Have a very Merry Christmas.
Potential script closure issue
I've also sent them code for what is probably the same underlying problem with closures. At least I've been able to work around it in my code.