Skip to main content
June 8, 2012
Pergunta

Blocking the refresh of photoshop

  • June 8, 2012
  • 2 respostas
  • 1979 Visualizações

Hi,

Is there a way in javascript to block the refresh of photoshop ?

I'm having a script that is hiding and showing layers, but as I have hundreds of them, and photoshop refreshing the interface each time I change the visibility of a layer, it gets extremly slow ...

I'm only interested but the end result, not the in-between steps.

If you have any idea, please let me know !

Thanks a lot,

Julien

Este tópico foi fechado para respostas.

2 Respostas

Jarda Bereza
Inspiring
September 11, 2017

Thanks David... now it makes sense.

So I assume that scripts in modern Photoshop are accelerated by default.

Chuck Uebele
Community Expert
Community Expert
June 12, 2012

var idsetd = charIDToTypeID( "setd" );

var desc3 = new ActionDescriptor();

var idnull = charIDToTypeID( "null" );

var ref2 = new ActionReference();

var idPrpr = charIDToTypeID( "Prpr" );

var idPbkO = charIDToTypeID( "PbkO" );

ref2.putProperty( idPrpr, idPbkO );

var idcapp = charIDToTypeID( "capp" );

var idOrdn = charIDToTypeID( "Ordn" );

var idTrgt = charIDToTypeID( "Trgt" );

ref2.putEnumerated( idcapp, idOrdn, idTrgt );

desc3.putReference( idnull, ref2 );

var idT = charIDToTypeID( "T   " );

var desc4 = new ActionDescriptor();

var idperformance = stringIDToTypeID( "performance" );

var idperformance = stringIDToTypeID( "performance" );

var idaccelerated = stringIDToTypeID( "accelerated" );

desc4.putEnumerated( idperformance, idperformance, idaccelerated );

var idPbkO = charIDToTypeID( "PbkO" );

desc3.putObject( idT, idPbkO, desc4 );

executeAction( idsetd, desc3, DialogModes.NO );

Participant
December 18, 2012

I have CS6 on Win 7 64 bit and the above code gives me an error: illegal argument.

Any help?  My scripts are running quite slow due to all of the image refreshing and I'd love to be able to block that.

Inspiring
December 18, 2012

Some times this forum's software strips out what it thinks are extra spaces in text. Make sure that charIDToTypeID( "T   " ) has 3 spaces inside the quotes. CharIDs must have 4 characters.