Skip to main content
Damon D Bell
Known Participant
January 15, 2016
Question

How to open the tool options panel?

  • January 15, 2016
  • 1 reply
  • 604 views

Is there a way to open the tool options panel in a script (the one from the menu under Window > Options). 

I figure this would probably need done using app.runMenuItem (stringIDToTypeID ("AddStringHere"));.  I've been looking throught the string terminologies in the SDK files.  However, I can't seem to figure out if there is a string to command opening the options panel.

This topic has been closed for replies.

1 reply

SuperMerlin
Inspiring
January 15, 2016

app.runMenuItem(charIDToTypeID('TglO'));

Damon D Bell
Known Participant
January 15, 2016

Thanks SuperMerlin.  I now see that in the in the PITerminology.h document from the SDK.  One question though......

Is there a way to see if it is already opened?  That command toggles it which either opens or closes it depending on if the user has it already opened.  I want the script to open it if is not already opened but not close it if it is already opened.

SuperMerlin
Inspiring
January 15, 2016

I just found this work around if there is no way to detect if it is already open.  The toggle palettes will close everything.  Then the command to toggle the option panel will open just that panel.  Then toggling the palettes again will open everything back up the way it was and the options panel will remain open.  This gives the exact same result whether the options panel is opened or closed to start.

togglePalettes();

app.runMenuItem(charIDToTypeID('TglO'));

togglePalettes();


I have just worked this out...

alert(isOptionsVis());

function isOptionsVis(){

var ref = new ActionReference();

ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );

var desc = executeActionGet(ref).getList (stringIDToTypeID('panelList'));

for(var a = 1;a<desc.count;a++){

    var Name = desc.getObjectValue(a).getString (stringIDToTypeID('name'));

    if(Name == 'Marquee Options'){

        return desc.getObjectValue(a).getBoolean(stringIDToTypeID('visible'));

        break;

        }

    }

};