How do I manipulate files from Bridge in PS 2?

General Discussion of Scripting for Adobe Bridge

Moderators: Tom, Kukurykus

Jason

How do I manipulate files from Bridge in PS 2?

Post by Jason »

I am very new at scripting. I have made a long, ridiculously complicated script that looks at files in a designated folder, opens them in CS2, manipulates them and saves them in designated folders.

I want to be able to open files using selections from Bridge rather than a designated folder, but I have no idea how to do this.

I read some of the posts and tried to use some of the sample scripts, but as I am very new at this, I don't even know where to begin picking these scripts apart.

let's say I want to run the script:

Code: Select alldoAction("Test 01", "Batch JavaScript");

How would I run this script for only selected items in Bridge?

Thanks for helping a newbie
xbytor

How do I manipulate files from Bridge in PS 2?

Post by xbytor »

Include the attached file and make this call:

Code: Select allvar files = XBridgeTalk.getBridgeSelection();

If bridge is running, it returns an array of files currently selected in Bridge. If Bridge isn't running, it returns an empty array.

-X
Andrew

How do I manipulate files from Bridge in PS 2?

Post by Andrew »

If you write your script to work on the open image (ie leave all the file selection and batching out) you could then use my scripts Photoshop Launch 4 or BridgeLaunch 4 to bring the files across from Bridge and to run the script on them.

For more advanced interactions you can use my script Photoshop Commander (in the beta testing forum) to run any combination of your scripts and actions (plus any number of save as stages and destinations) on files selected in Bridge. In most cases with Photoshop Commander you can do without the script writing by use of actions to cover the 'do things' bits.

Andrew
Jason

How do I manipulate files from Bridge in PS 2?

Post by Jason »

I think X's script will do the trick. I need my script to read the file names before they are opened, so I'm not sure that Andrew's script will work in my situation. I will be happy to look at it, though. I might get some ideas for future projects.

Thank you both for your help!
Andrew

How do I manipulate files from Bridge in PS 2?

Post by Andrew »

I'm sure X's script will work well for you but just for the record...

Bridge Launch 4 and Script Launch 4 can both pass a string containing the list of selected files in Bridge to the target script - see the docs. And Photoshop Commander can work on images before they are open also (and choose not to open them as well). One of the benefits of these scripts is they provide a built-in UI for script launching, file selection, file filtering and file saving to scripts that need to 'do something' with image files.

Andrew