# Communicating with Photoshop, ie sending files/variables



## Reimund (May 19, 2011)

Hi there Lightroom devs!

I'm creating a script/extension for Photoshop that operates on an arbitrary number of images. Basically it's a diptych automator. You can check it out here: http://lumens.se/tychpanel/

I think it would be nice to be able to call the script from Lightroom with selected images as input. But what are my options here?

I've read some about Droplets, which I think might work. Ie, by making an action that in turn calls the scripts. It's not very elegant though so I'm hoping for a better solution. Any suggestions are very welcome.

Thanks!


----------



## johnbeardy (May 19, 2011)

Droplets placed in the export actions folder, or added as external editors, would normally be the easiest way. The alternative would be to invoke your AppleScript (if it is one) as a Folder Action through the Mac OS. In each case I suspect your problem will be that the droplet/action will be invoked once for each Lightroom export/edit with command.

My OpenDirectly plugin would be able to handle it, if you are sending _originals_ to Photoshop (it has an option which could invoke the droplet once with multiple files as arguments).

To get a bit further, how does your code currently select images?

John


----------



## Reimund (May 20, 2011)

I have javascript that selects files either via File.openDialog or, if Bridge is running and a selection is present, using a BridgeTalk script.

Using the Droplet approach would probably be very ugly indeed. I'd need to invoke a script in an action, and that script must figure out if the current invokation is on the first file in the set, or not.

What do you mean exactly with "originals"? Un-edited images? In that case that would not work.


----------



## johnbeardy (May 20, 2011)

By originals, yes I do mean the original files. If you can't send raws, then export some tif/jpegs, bring them back into the catalogue and run OpenDirectly on them.

You might look at Photoshop's Events Manager, which can launch scripts in response to events like files being opened. It might abort if <x files are open, but proceed if all your files are open.

Other than that, LR's SDK can run shell scripts.


----------



## Reimund (May 21, 2011)

Basically I just want to pass an array of strings containing filenames to a Photoshop script.

According to this thread http://forums.adobe.com/message/2201012 Lightroom might use BridgeTalk to communicate with Photoshop. Although I cannot find any documentation of that.

Using the LR SDK and a shell script might work. After looking into this however, I haven't found a convenient way to run PS scripts from the shell (ie with no popups, not opening EST, working on both Win/Mac OSX etc). I guess one could serialize the array to file, and then read it with the PS script. Although then I'd need to find a way read a file upon modification without using polling.


----------



## Joana (Oct 12, 2011)

This sounds really interesting. I think I would be very interested in a script like this, but this stuff is way over my head. Did you ever figure this out? If so, is it available for download? I have been considering buying a new system, because I have been having problems running the software. I just don't think mine has enough speed to keep up. Can someone recommend a good system? I have been thinking about checking out hh gregg to see what they have, would this be advisable? I have never really been there, so I don't know what to expect. I appreciate your help, thank you.


----------

