Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Maybe through invoke()?
Copy link to clipboard
Copied
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.");
}
Copy link to clipboard
Copied
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.");
}
Copy link to clipboard
Copied
If it helps, this works in AppleScript.
tell application id "com.adobe.InDesign"
activate
set visible of panel "Info" to true
end tell
Copy link to clipboard
Copied
As @Nick Passmore suggested - you need to refer to Panels collection - not menu:
var myPanel = app.panels.item("$ID/Info Panel");
myPanel.visible = true;
Copy link to clipboard
Copied
Hi Mike, this works for me
var ip = app.menuActions.itemByName("Info")
//or var ip = app.menuActions.itemByID("89089")
if(!ip.checked){
ip.invoke();
};
Copy link to clipboard
Copied
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".
Copy link to clipboard
Copied
This doesn't work?
Copy link to clipboard
Copied
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();
};
};
Copy link to clipboard
Copied
Once it's open - no - but before opening InDesign - yes:
But it's rather overkill...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now