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

Script to show panels

Community Expert ,
Jan 19, 2024 Jan 19, 2024

Hi gang,

I cannot find a script that shows specific panels in the dock. Does anyone have an example of script that shows/calls forth a named panel into the dock? Or even a script line that calls forth into view a panel in the middle of the screen floating free?

Mike Witherell
TOPICS
How to
593
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
LEGEND ,
Jan 19, 2024 Jan 19, 2024

Maybe through invoke()? 

 

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
Community Expert ,
Jan 19, 2024 Jan 19, 2024

I tried this but it did not work:

 

// Check if InDesign is running
if (app && app.name === "Adobe InDesign") {
  // Invoke the Info panel
  app.scriptMenuActions.item("$ID/Info Panel").invoke();
} else {
  alert("Adobe InDesign is not running.");
}

 

Mike Witherell
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
Community Expert ,
Jan 19, 2024 Jan 19, 2024

Similarly, this did not work:

// Check if InDesign is running
if (app && app.name === "Adobe InDesign") {
  // Invoke the Info panel
  app.menuActions.itemByID(208).invoke(); // ID 208 corresponds to the Info panel
} else {
  alert("Adobe InDesign is not running.");
}
Mike Witherell
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
Participant ,
Jan 20, 2024 Jan 20, 2024

If it helps, this works in AppleScript.

 

tell application id "com.adobe.InDesign"

   activate

   set visible of panel "Info" to true

end tell

 

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
LEGEND ,
Jan 20, 2024 Jan 20, 2024

@Mike Witherell 

 

As @Nick Passmore suggested - you need to refer to Panels collection - not menu:

 

var myPanel = app.panels.item("$ID/Info Panel");

 

myPanel.visible = true;

 

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
Community Expert ,
Jan 20, 2024 Jan 20, 2024

Hi Mike, this works for me

 

var ip =  app.menuActions.itemByName("Info")
//or var ip =  app.menuActions.itemByID("89089")
if(!ip.checked){  
    ip.invoke();  
};  

 

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
Community Expert ,
Jan 20, 2024 Jan 20, 2024

Hi Robert and Rob,

Thanks for the assist. Rob, your script works for showing one panel, but when I duplicated it by 14 panels I wanted to show, it didn't work. I'm trying to show 14 of my favorite every-day panels, make them show up in a dock, and have it save the workspace as "IDclass".

Mike Witherell
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
LEGEND ,
Jan 20, 2024 Jan 20, 2024

This doesn't work?

RobertTkaczyk_0-1705791323443.png

 

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
Community Expert ,
Jan 20, 2024 Jan 20, 2024

I don’t think there is a way of positioning or docking a panel once it’s open. I can create an array of panel ID numbers, close all the panels, loop through and open them, but the position is random:

 

//["Info", "Transform", "Layers", "Links"];
var pa = [89089, 132609, 30220, 18433];

var mn;
for (var i = 0; i < pa.length; i++){
    mn =  app.menuActions.itemByID(pa[i])
    if(!mn.checked){  
        mn.invoke();  
    }; 
};   

 

Screen Shot.pngScreen Shot 1.png

 

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
LEGEND ,
Jan 20, 2024 Jan 20, 2024
LATEST

Once it's open - no - but before opening InDesign - yes:

RobertTkaczyk_2-1705792986782.png

 

RobertTkaczyk_1-1705792941061.png

 

But it's rather overkill...

 

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