-
1. Re: How to speed up script loading and processing time?
Michael L Hale Sep 16, 2009 12:49 PM (in response to mazmax)That mostly depends on what the script does. Iterating layers and working with textItems for example can be slow, sometimes very slow.
You can profile your script in ESKT to see how long each part of your code runs. Once you know where the bottleneck is you can try to rewrite that part to speed this up.
-
2. Re: How to speed up script loading and processing time?
c.pfaffenbichler Sep 18, 2009 2:21 AM (in response to Michael L Hale)Michael, haven’t You in some other thread provided the code to set the Playback Options to accelerated and toggle Panels to increase speed?
-
3. Re: How to speed up script loading and processing time?
Michael L Hale Sep 18, 2009 7:34 AM (in response to c.pfaffenbichler)The playback functions are from Xbytor
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };Stdlib = function Stdlib() {};
Stdlib.setActionPlaybackOptions = function(opt, arg) {
function _ftn() {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putProperty(cTID("Prpr"), cTID("PbkO"));
ref.putEnumerated(cTID("capp"), cTID("Ordn"), cTID("Trgt"));
desc.putReference(cTID("null"), ref );
var pdesc = new ActionDescriptor();
pdesc.putEnumerated(sTID("performance"), sTID("performance"), sTID(opt));
if (opt == "pause" && arg != undefined) {
pdesc.putInteger(sTID("pause"), parseInt(arg));
}
desc.putObject(cTID("T "), cTID("PbkO"), pdesc );
executeAction(cTID("setd"), desc, DialogModes.NO);
}
_ftn();
};
Stdlib.setPlaybackAcclerated = function() {
Stdlib.setActionPlaybackOptions("accelerated");
};
Stdlib.setPlaybackStepByStep = function() {
Stdlib.setActionPlaybackOptions("stepByStep");
};
Stdlib.setPlaybackPaused = function(delaySec) {
Stdlib.setActionPlaybackOptions("pause", delaySec);
};I may have posted panel functions somewhere but if I did I didn't add them to my code lib and can't find them off hand.
But I think that things like hiding panels and setting the zoom to some small percent only make the script marginally faster. The first step I would take would be to profile in ESTK
-
4. Re: How to speed up script loading and processing time?
mazmax Sep 18, 2009 8:06 AM (in response to Michael L Hale)Pardon my ignorance... what's ESTK?
-
5. Re: How to speed up script loading and processing time?
Michael L Hale Sep 18, 2009 9:51 AM (in response to mazmax)It's shorthand for ExtendScript ToolKit, the editor/debugger that ships with Photoshop.
-
6. Re: How to speed up script loading and processing time?
mazmax Sep 18, 2009 10:23 AM (in response to Michael L Hale)Ahhh it's the one I'm using hehe


