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?
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.
But app foreground color is a property that you can set before calling this…?
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.
I think Mark was trying to give a hint …
var foreColor = new SolidColor; foreColor.rgb.red = 0; foreColor.rgb.green = 255; foreColor.rgb.blue = 255; app.foregroundColor = foreColor;