Skip to main content
Legend
October 30, 2019
Question

Scripting: How to add my Photoshop script to the Bridge menu?

  • October 30, 2019
  • 2 replies
  • 3557 views

I have several scripts that work in Photoshop, but in some situations they get files from the bridge (via BridgeTalk ()). Everything works fine, but I would like to make it possible to call my script not only from Photoshop, but also from the Bridge menu (taking into account that the script has #target photoshop and located in the folder with Photoshop presets).


I found several examples, but all of them involve either adding a menu item or using the startup folder bridge (I still can’t figure out how to access this directory from the script itself (win + macos) to copy some fragment that calls the script , or through # target bridge (the menu is added while the script is running until the bridge is restarted)).

 

I am sure that someone was trying to solve the same problem, could you share ideas on how to do this better?

This topic has been closed for replies.

2 replies

Legend
October 30, 2019

Look at the sample scripts which ship with the Bridge SDK and also  the glue scripts installed by Photoshop. They show clearly how to create Bridge menu items.

jazz-yAuthor
Legend
October 30, 2019

I made a test script and quite successfully created a menu item that calls the main script with the parameters I need. In this part I have no questions. The main problem at the moment is how to register this script so that it automatically fits into the bridge menu (and is always there). I found only ready-made examples when the script is already registered and placed by Startup Scripts, but I did not find how to make this placement 🙂

I think that I’ll just make an offer to the user to start Photoshop from the administrator account so that my script can copy the initialization module into Startup Scripts. But this decision seems to me not the best ...

 

UPD

 

var ss= new Folder ( $.getenv ("APPDATA") + "/Adobe/Bridge CC 2019/Startup Scripts")

 

on windows i can put scripts here, but question - how to correctly build bridge version folder (Bridge CC 2019) if i changes

Legend
October 31, 2019

There is no such thing as "registering." Your script has to go into one of the folders which are read by CC applications. From there it creates Bridge menu items.

Chuck Uebele
Community Expert
Community Expert
October 30, 2019

I'm  not sure of an easy way to do that. I used to have a PS script that I could run from PS or Bridge. I've never had a lot of luck with Bridge talk, so my script didn't have it. What i did so was edit the main startup script for PS: photoshop.jsx. now i think they have the year in the name. This worked well, but i had to re-edit it every time a new major update to PS came out. What i did was basically copy part of that script that initiated another PS script like image processor, and just plugged in my info for my script.

jazz-yAuthor
Legend
October 30, 2019

not necessary to modify photoshop.js - just place the script that initializes the launch in \ Common Files \ Adobe \ Startup Scripts CC \ Adobe Photoshop \
There are no problems with manual copying, however, I wanted to automatically add the script to the menu - there are problems with access rights (the folder is writable only for administrators) 

 

for example, code 

var ss= new Folder ($.getenv ("COMMONPROGRAMFILES") + "/Adobe/Startup Scripts CC/Adobe Photoshop/")
alert (ss.create())

alerts "false" if user not administrator