Photoshop CS2 - Obtaining List of Files Selected in Bridge

Upload Adobe Bridge Scripts, Download Adobe Bridge Scripts, Support for Individual Adobe Bridge Scripts

Moderators: Tom, Kukurykus

miked

Photoshop CS2 - Obtaining List of Files Selected in Bridge

Post by miked »

I switched over to CSX so that I can figure things out a bit better I hope. Reading the code, this is what is happening, and please correct me if I have something wrong:

1. the menu item runs .runFromBridge, which I understand.

2. .runFromBridge calls .getSelectedFiles which returns a list of file specs based on the selections, which I understand.

3. .runFromBridge then builds a bridgetalk object, which I understand.

4. then sends it to .run, which I understand.

5. .run then does two things I don't understand. First it uses a UUID, and second it uses something called runActionCommand. Ai also assume that if I am oly trying to support CS3, that I can stop at the "if (CSXBridge.isCS3()) {" line.

So I guess my next questions are:

What is the purpose of a UUID, and is it based on something or can I just make one up? I see it's included in a text block at the top, does that block signify something?

Second, WTF is runActionCommand I can't find that one in any manual ( the bridge CS3 stuff from the SDK or the PS one).

Thanks for the help, you have no idea how much I appreciate it.

...Mike[/list]
miked

Photoshop CS2 - Obtaining List of Files Selected in Bridge

Post by miked »

Ah, I see you were posting when I was. I'll read what you wrote and see what happens

...Mike
miked

Photoshop CS2 - Obtaining List of Files Selected in Bridge

Post by miked »

xbytor wrote:at the top of the file. That tells PS that it's an automation plugin.
-X

The existence of this block indicates this, or the fact that it is in teh automate menu?

...Mike
xbytor

Photoshop CS2 - Obtaining List of Files Selected in Bridge

Post by xbytor »

miked wrote:5. .run then does two things I don't understand. First it uses a UUID

UUIDs are required for the script to look and act like a plugin from the POV of both Bridge and PS. I gen my UUIDs here:
http://www.famkruithof.net/uuid/uuidgen

I create a new one for each new release of CSX. It keeps me from having versioning problems.

and second it uses something called runActionCommand.

runActionCommand is a way of invoking events/actions/etc... via an ActionDescriptor. You don't have to explicitly specify the script. The script just has to have that XML Resource block at the beginning of the script so that PS sees it and registers it for later use.

Ai also assume that if I am oly trying to support CS3, that I can stop at the "if (CSXBridge.isCS3()) {" line.


Just look that the isCS3() code. Most of the stuff in there having to do with the INI file is so that (in CS2) I invoke the correct CSX script. It's probably not strictly necessary, but I find it invaluable during development.


So I guess my next questions are:

What is the purpose of a UUID, and is it based on something or can I just make one up? I see it's included in a text block at the top, does that block signify something?


Explained above.

Second, WTF is runActionCommand I can't find that one in any manual ( the bridge CS3 stuff from the SDK or the PS one).


It's defined in photoshop10.jsx.

-X
xbytor

Photoshop CS2 - Obtaining List of Files Selected in Bridge

Post by xbytor »

miked wrote:The existence of this block indicates this, or the fact that it is in teh automate menu?

Actually, it has to have the eventid entry for it to be an automation plugin. The whole terminology block is ignored. In the future, it should allow the arguments to be displayed in the Actions palette after a script automation plugin has been recorded.

-X
miked

Photoshop CS2 - Obtaining List of Files Selected in Bridge

Post by miked »

Thanks tonnes X, I'll keep pluggin away

...Mike