Hi, The only problem is that it never knows if it is already visible or invisible. This solves that (the code is old and is not mine - sorry I can't remember its author). The advantage (with some errors in some of the panels) is that you can use this over the panels: // // this is the full list of all palettes //~ Tools //~ Pen Options //~ Actions //~ Styles //~ Swatches //~ Histogram //~ Info //~ Paths //~ Tool Presets //~ Color //~ Channels //~ Layers //~ Layer Comps //~ Timeline //~ Clone Source //~ Measurement Log //~ History //~ Navigator //~ Character //~ Paragraph //~ Character Styles //~ Paragraph Styles //~ Glyphs //~ Notes //~ 3D //~ Adjustments //~ Properties //~ Modifier Keys //~ Brush //~ Brush Presets //~ Device Preview //~ Libraries // for example I want to open the Paths pallete if closed: //~ openClosePSPanels("Info", true); //~ // for example I want to close the Paths pallete if opened and it has focus: openClosePSPanels("Info", false); // this only works if the Path panel has the focus function openClosePSPanels(name, visibility) { var panelList = listPanels(); for ( var a in panelList ) { if ( panelList[0].toString() == name) { if (panelList[1].toString() != visibility.toString()) { if (panelList[0].toString() == "Notes") name = "Annotation"; // exception on Notes palette try { app.runMenuItem ( stringIDToTypeID ("toggle" + name.replace(/\s/g,'') + "Palette") ); } catch (e) {} break; } } } function listPanels() { var ref = new ActionReference(); Info = new Array(); ref.putProperty( stringIDToTypeID("property"), stringIDToTypeID("panelList") ); ref.putEnumerated( stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum") ); var desc = executeActionGet(ref).getList( stringIDToTypeID("panelList") ); for( var a = 0; a<desc.count; a++ ) { var Name = desc.getObjectValue(a).getString( stringIDToTypeID("name") ); var Vis = desc.getObjectValue(a).getBoolean( stringIDToTypeID("visible") ); var Ob = desc.getObjectValue(a).getBoolean( stringIDToTypeID("obscured") ); var ID = desc.getObjectValue(a).getString( stringIDToTypeID("ID") ); Info.push( [[Name], [Vis], [Ob], [ID]] ); } return Info; } } // ARRAY of Palettes: //~ Tools,true,false,panelid.static.toolbar //~ Brush Options,true,false,panelid.static.options //~ Actions,false,false,panelid.static.actions //~ Styles,false,false,panelid.static.styles //~ Swatches,false,false,panelid.static.swatches //~ Histogram,false,false,panelid.static.histogram //~ Info,false,false,panelid.static.info //~ Paths,false,false,panelid.static.paths //~ Tool Presets,false,false,panelid.static.toolpresets //~ Color,false,false,panelid.static.picker //~ Channels,false,false,panelid.static.channels //~ Layers,true,false,panelid.static.layers //~ Layer Comps,false,false,panelid.static.comps //~ Timeline,false,false,panelid.static.animation //~ Clone Source,false,false,panelid.static.clonesource //~ Measurement Log,true,false,panelid.static.measurement //~ History,true,false,panelid.static.history //~ Navigator,false,false,panelid.static.navigator //~ Character,false,false,panelid.static.textcharacter //~ Paragraph,false,false,panelid.static.textparagraph //~ Character Styles,false,false,panelid.static.textcharstyle //~ Paragraph Styles,false,false,panelid.static.textparastyle //~ Glyphs,false,false,panelid.static.textglyphspanel //~ Notes,false,false,panelid.static.annotation //~ 3D,false,false,panelid.static.3d //~ Adjustments,false,false,panelid.static.create //~ Learn,false,false,panelid.static.learn //~ Properties,false,false,panelid.static.properties //~ Brush Settings,false,false,panelid.static.brushstyler //~ Brushes,false,false,panelid.static.brushpresets //~ Libraries,false,false,panelid.dynamic.swf.csxs.com.adobe.DesignLibraries.angular //~ Adobe Color Themes,false,false,panelid.dynamic.swf.csxs.KLR //
... View more