Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script to open a panel Error Message

New Here ,
Jun 21, 2014 Jun 21, 2014

so i have this code that opens a panel with a script which i have given a hotkey. As i would like a hotkey for my panel, but the problem i am having is that it does not work with my panel only with others, I build the panel with configuration and need some help debugging.

//////////////////////////////////////////////////////////////This is the Script for the code

#target photoshop

openPanel('CommandBar');

function openPanel(Name)

{

    var desc1 = new ActionDescriptor();

    var ref1 = new ActionReference();

    ref1.putName( charIDToTypeID('Mn  '), Name);

    desc1.putReference( charIDToTypeID('null'), ref1 );

    try

  {

    executeAction( charIDToTypeID('slct'), desc1, DialogModes.NO );

    }

  catch(e)

  {

  alert(e.message);

  }

};

//////////////////////////////////////////////////////////////////////////

error dialog when running with my panel: "- The object “menu item “CommandBar”” is not currently available."

TOPICS
Actions and scripting
650
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Jun 23, 2014 Jun 23, 2014

Maybe 'ComandBar' is not the name of your panel, you can use this script to get the list of name to all the panels from Photoshop:

function getPanelsList(){

  var ref = new ActionReference();

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

  var applicationDesc = executeActionGet(ref);

  var panelList = applicationDesc.getList(stringIDToTypeID('panelList'));

    var pL = "PanelList:\n"

  for (var m = 0; m < panelList.count; m++) {

    var thisPanelD

...
Translate
Adobe
Community Expert ,
Jun 22, 2014 Jun 22, 2014

What kind of a Panel is "CommandBar" supposed to be?

I build the panel with configuration

Did you mean you built it with Configurator?

Which Photoshop version do you use?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 22, 2014 Jun 22, 2014

yes i meant to say i built it with Configurator and i am using cs6

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 23, 2014 Jun 23, 2014

Maybe 'ComandBar' is not the name of your panel, you can use this script to get the list of name to all the panels from Photoshop:

function getPanelsList(){

  var ref = new ActionReference();

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

  var applicationDesc = executeActionGet(ref);

  var panelList = applicationDesc.getList(stringIDToTypeID('panelList'));

    var pL = "PanelList:\n"

  for (var m = 0; m < panelList.count; m++) {

    var thisPanelDesc = panelList.getObjectValue(m);

       pL += (thisPanelDesc.getString(stringIDToTypeID("name")) + "\n");

    }

       alert(pL);

}

getPanelsList();

and than you will see if your panel can be accessed by script or not, and with what name.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 28, 2014 Jun 28, 2014
LATEST

Great Thank You for your Help!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines