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

Disable Photoshop Screen Update During Script

New Here ,
Jun 10, 2009 Jun 10, 2009

I am doing a set of instructions on each layer in my document and when Photoshop is in the front, and I can see the things happening, and the instructions for each layer take about 1 second each.  I noticed that when Photoshop was minimized, the instructions were much, much faster.  I was wondering if I could, through script, disable the screen update and then when I was finished, re-enable the update?

Thanks in advance

Carl

TOPICS
Actions and scripting
2.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
Adobe
Guru ,
Jun 10, 2009 Jun 10, 2009
LATEST

Here are several things you can do to make the script run faster. First make sure the playback options are set to accelerated. Here is some code 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);
};

next togglePalettes() to hide the palettes.

And set doc view to as small as it will go. This doesn't help that much so may not be worth the effort.

runMenuItem(  charIDToTypeID("ActP") );// fit on screen
for(var z = 0; z < 17;z++){
     runMenuItem( charIDToTypeID("ZmOt") );
}

But even with all that, working with layers using the scripting API can be slow.

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