Skip to main content
Known Participant
May 28, 2011
Question

How do I disable dialogs? (javascript, PcCS5)

  • May 28, 2011
  • 2 replies
  • 1444 views

I have a script which fills the layer with a certain color:

docRef.selection.fill(fillColor, ColorBlendMode.NORMAL, 100, true);

I have recorded the script into an action, since I want to batch it on a collection of files.

But, when I run my script with my action, the fill dialog window pops up!

I tried this to get rid of it, but it didn't work:

app.displayDialogs = DialogModes.NO;
displayDialogs = DialogModes.NO;

Is there any way I can get rid of that dialog?

This topic has been closed for replies.

2 replies

Known Participant
June 3, 2011

This is how i do it.

var selection = docRef.selection

var desc203 = new ActionDescriptor();

var desc204 = new ActionDescriptor();

desc204.putUnitDouble(     charIDToTypeID( "Hrzn" ), charIDToTypeID( "#Pxl" ), 0 );

desc204.putUnitDouble(     charIDToTypeID( "Vrtc" ),  charIDToTypeID( "#Pxl" ), 0 );

desc203.putObject(          charIDToTypeID( "From" ), charIDToTypeID( "Pnt " ), desc204 );

desc203.putInteger(         charIDToTypeID( "Tlrn" ),   100 );

desc203.putBoolean(        charIDToTypeID( "Mrgd" ), true );

desc203.putBoolean(        charIDToTypeID( "AntA" ), true );

desc203.putEnumerated(  charIDToTypeID( "Usng" ), charIDToTypeID( "FlCn" ), charIDToTypeID( "FrgC" ) );

executeAction( charIDToTypeID( "Fl  " ), desc203, DialogModes.NO );//  fill selected area

No way to pick a color though but it will use the fore color in the color picker thingy whatever its called.

Muppet_Mark-QAl63s
Inspiring
June 4, 2011

But app foreground color is a property that you can set before calling this…?

Known Participant
June 6, 2011

Of course it is I just select the color manually and leave it as I never change it.

However, you probably want it programatically, Which I don't have code for that off hand.

What you could do is record an action for it and put it in the code I posted above.

c.pfaffenbichler
Community Expert
Community Expert
May 29, 2011

I don’t think that should happen.

Are you absolutely certain it is this part of the Script?

What is selected when this line runs?

Could you post the Script and a screenshot of the Action?