Supsending UI updates

Anyone, especially newbies, asking for help with photoshop scripting and photoshop automation - as opposed to those contributing to discussion about an aspect of photoshop scripting

Moderators: Mike Hale, xbytor, Larry Ligon, Andrew, Patrick, PS-Moderators

Supsending UI updates

Postby poslundc » Fri May 01, 2009 1:15 am

Hi all,

I'm running a lengthy, complicated script and I see Photoshop churning just trying to keep the screen up-to-date.

Is there anyway to pause UI updates until such time as my script has completed?

Thanks,

Dan.
poslundc
 
Posts: 1
Joined: Thu Apr 30, 2009 11:18 pm

Postby Mike Hale » Fri May 01, 2009 2:55 am

In the GUI you can set the playback option in the action panel to accelerated.

Or you can use Xbytor's functions to do the same inside the script
Code: Select all
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.setPlaybackAccelerated = function() {
  Stdlib.setActionPlaybackOptions("accelerated");
};
Stdlib.setPlaybackStepByStep = function() {
  Stdlib.setActionPlaybackOptions("stepByStep");
};
Stdlib.setPlaybackPaused = function(delaySec) {
  Stdlib.setActionPlaybackOptions("pause", delaySec);
};
Mike Hale
Site Admin
 
Posts: 2735
Joined: Fri Sep 30, 2005 10:52 pm
Location: USA

Postby cmyk » Wed May 06, 2009 8:15 am

Not sure if you can pause the UI, but you could try hiding the palettes temporarily by using workspaces. Save a workspace in your normal working environment and another without any palettes visible. At the beginning of the script call the hidden palette workspace and at the end of the script call your regular workspace. Maybe even add a zoom to 8.33% or smaller magnification so the screen has less canvas area to refresh.
cmyk
 
Posts: 92
Joined: Tue Aug 22, 2006 8:30 pm


Return to Help Me

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron