Skip to main content
Known Participant
September 30, 2008
Question

Organize menus

  • September 30, 2008
  • 5 replies
  • 1160 views
Just a quick one. Is it possible to use JavaScript in Photoshop so that I can create sub-menus in the menubar/file/scripts. Using sub-directories does not work. I have quite a few examples of other peoples scripts in here. I was able to do this in Acrobat but can I do the same here? TVM
This topic has been closed for replies.

5 replies

Participant
October 16, 2024

I know this was 16 years ago. Dunno if you ever figured it out. I looked at the Image Processor File, and it had this on top:

/*
// BEGIN__HARVEST_EXCEPTION_ZSTRING

<javascriptresource>
<name>$$$/JavaScripts/ImageProcessor/Menu=Image Processor...</name>
<category>aaaThisPutsMeAtTheTopOfTheMenu</category>
<eventid>1F9021B1-5045-42E1-AE2A-7E504FAA8D50</eventid>
</javascriptresource>

// END__HARVEST_EXCEPTION_ZSTRING

*/

 

Note the AAA This puts me on top! The category thing actually does something. If you want it to be last, put zzz there. That's what I did. I had the same exact problem right now, in 2024. This solved it.

Known Participant
October 1, 2008
X, if you say this quote is incorrect then I'll be taking your word for this. It appeared to be simple enough, well I could not see where I could be going wrong. Tried numerous restarts etc. I was just trying to keep my attempts at learning some JavaScript away from the stuff that works if you get my drift. Its easy enough to stick with what I was doing ie. keeping my learning/testing stuff in a sub-folder prefixing the file names with a space character and having a blank text file named "-----------------------------.jsx" stupid work a rounds. An upgrade is well over due I shall add this to my list of reasons. The script file "Script Events Manager.jsx" some how has bar separators and the JavaScript files in the "Event Scripts Only" do not appear in the list but Im presuming that this is done some where in the application's framework. I shall stop flogging the horse now that I know its dead
Known Participant
September 30, 2008
BTW, this is what I had read in my CS2 manual but did not work as I expected.

Installing scripts
To install a JavaScript in the Scripts menu, place it in the Scripts folder (Photoshop CS2 > Presets >
Scripts). The names of the scripts in the Scripts folder, without the file name extension, will be displayed in
the Scripts menu. Any number of scripts may be installed in the Scripts menu.
Scripts added to the Scripts folder while Adobe Photoshop CS2 is running will not appear in the Scripts
menu until the next time you launch the application.
You may use sub-folders in the Scripts folder to help organize the scripts in the Scripts menu. Each
subfolder will be displayed as a separate submenu containing the scripts in that subfolder.
Known Participant
September 30, 2008
Mark_Larsen@adobeforums.com wrote:
> BTW, this is what I had read in my CS2 manual but did not work as I expected.

This is the 'misleading' bit of docs I spoke of before. It doesn't work but it
wouldn't hurt to make another feature request.

-X
Known Participant
September 30, 2008
Thanks for the info X, in Acrobat I was able to make my own menu items by adding some small JavaScript snippets of code into the User Library/Acrobat User Data. I was not sure if there was a mechanism to do this in Photoshop. The reason why I was asking is I have your Tool kit amongst quite a few other script samples and thought it might be better if I could do some sort of sorting into groups as opposed to the single list alpha sort that I have. My next question would have been if it is possible then would it have broken all the path info in your tool kit most likely a yes? Never mind it was only an idea. The kind of thing I was thinking of is like what I have in Bridge where Dr Browns Services 1.5 submenus with dividers all very neat and tidy. I only have CS2 but I will see if I can work out the file/automate grouping thing. If you've not got this in CS4 do you think its worth asking for in a feature request?
Known Participant
September 30, 2008
Mark_Larsen@adobeforums.com wrote:<br />> I only have CS2 but I will see if I can work out the file/automate grouping thing. <br /><br />The <javaresource> bit only works in CS3+.<br /><br />Submenus like those in Bridge, would be very nice to have in PS.<br /><br />-X
Known Participant
September 30, 2008
Mark_Larsen@adobeforums.com wrote:<br />> Just a quick one. Is it possible to use JavaScript in Photoshop so that I can create sub-menus in the menubar/file/scripts. Using sub-directories does not work.<br /><br />I think there actually was a rev of the docs that implied the subdirectory trick <br />would work. But it doesn't.<br /><br />The best you can do is to add a JavaScript Resource block (pp. 204 in the CS3 js <br />ref guide). You can group scripts in the File->Automate menu by putting them in <br />the same 'category'.<br /><br />Script #1<br /><br />// ContactSheetX.jsx<br />/*<br /><javascriptresource><br /><name>Contact Sheet X</name><br /><type>automate</type><br /><about>A short string providing information about CSX.</about><br /><enableinfo>true</enableinfo><br /><category>xtools</category><br /></javascriptresource><br />*/<br /><br /><br />Script #2<br /><br />// AddWatermark.jsx<br />/*<br /><javascriptresource><br /><name>Add Watermark</name><br /><type>automate</type><br /><about>A short string providing information about AddWatermark.</about><br /><enableinfo>true</enableinfo><br /><category>xtools</category><br /></javascriptresource><br />*/<br /><br /><br />This will place the two scripts in the same section in the automate menu. There <br />is no mechanism that I've found that will permit the creation of submenus of any <br />kind from within JavaScript.<br /><br />Also, the <eventid> part is useful if you want to simplify having your script <br />called from Bridge. The <terminology> section doesn't really do anything useful <br />in CS3. I haven't tested it to see if that's changed for CS4 or not but not <br />having it doesn't seem to cause any problems.<br /><br />-X