AH Dynamic Scripts Menu for Bridge

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

Moderators: Tom, Kukurykus

Andrew

AH Dynamic Scripts Menu for Bridge

Post by Andrew »

Important Notice: I am currently in the process of releasing full non-beta versions of all my scripts and as of today - 18 Feb 2006 - am withdrawing all outstanding beta versions. To stay in touch with the full-release rollouts, subscribe to the thread:

Andrew Hall - Script Development, Update List

bb/viewtopic.php?t=190&start=15

The new versions will have much improved dialogs, better integration with Bridge and many new features.

Andrew Hall 18 Feb 2006]

AH Dynamic Scripts Menu for Bridge is a menu generator for launching scripts which will run on any target Adobe Creative Suite application eg Photoshop. For Photoshop you can also add actions. Use the Edit Script List dialog to easily add or remove scripts from the target list. The list is then displayed both under a Scripts heading in the Main Bridge menu, and also as a right-click context menu for selected images in the content pane.





The list of scripts is first ordered by target application (note the separators) and then alphabetically.

How you select / click the script link determines what the link does:

1. Normal: Left-Click: runs the script

2. Batch: Open -Close: Shift + Left-Click: opens each selected image in the target application one at a time, runs the script on the image, then closes the image saving changes.

3. Batch Leave Open: Ctrl or Cmd plus Left-Click: does the same as 2 but leaves the images open.

4. Ctrl or Cmd plus Shift plus Left-Click: Sends the list of selected files to the target app / script for the script to work with. The files are sent as a string variable called ah_BridgeFilesAsString which if run through 'eval' will convert the string back to a file object.

The next version of the script will simplify these techniques for users, but it is not difficult once you get the hang of it.


When you first run the menu generator there will be no scripts listed, just the Edit Script List command. Click this and you open the following dialog:



The dialog provides 'set up' controls, identifies the Current Folder - from which you can select scripts, and lays out your current script list plus target app for each script. To run through the controls:

Add script: browse to a folder to add a script to the list

Remove: removes the currently selected script from the list

List All: lists all .js and .jsx scripts in the current folder.

Folder: opens browse to select a new current folder. This is the way you navigate to link to scripts for a different application.

Add Action: allows you to add Photoshop Actions and run them from Bridge. Left-Click will run them but not use the Bridge selections. Shift+Left-Click and Ctrl/Cmd+LeftClick will run them in Batch mode as described above.






Add Found: looks in the current folder and adds any new scripts that fit the search criteria to the existing list

Found Only: deletes the existing file list, looks in the current folder and and inserts only files meeting search criteria (a quick way of emptying your list is to search for ZZ)

<search>: this is where you enter search criteria. It is Regular Expression based and is case sensitive.


Edit App: this allows you to change the target application for any script.



OK: confims your edits to the menu. Currently you have to restart Bridge to see the changes.

Quit: quits without implementing any of your changes.

Warning: do not add multiple scripts to the list that have the same exact name plus the same target application, it sends the Bridge menu haywire.

The search process has all the power of regular expressions but at a basic level it is easy to use.

ah-l will search for 'ah-l' anywhere in the script name.

h.l will search for 'h' 'one character' 'l'

h.*l will search for 'h' followed by 'l' with 0 or more characters in between.

h.+l will search for 'h' followed by 'l' with 1 or more characters in between.

When you want to include fullstop in your search you need to use '\.'

Installation:

Drop all five files in your StartupScripts folder. To find where that is, open Bridge and click Edit>>Preferences>>General>>Reveal. Put the files in there.

There are two AH files:

ah_bridge_scripts_menu.jsx
ah_bridge_scripts_menu_editor.js

There are three Adobe Library files that you may or may not already have installed.

AdobeLibrary1.jsx
AdobeLibrary2.jsx
AdobeLibrary3.jsx

Restart Bridge and you will see the two new menu items.

Demonstration Target Scripts

I am including as a separate download three sample scripts that demonstrate usage (and allow you to test that all is working). Put them anywhere you want and then load them into the menu using the Add Script button. Each time you add a script you will be asked to identify the target application.

1. ah_bridge_runScript_test.js: target Photoshop

This tests ordinary left-click running for scripts that do not need Bridge to open files for them etc. Photoshop will come to the front and run the script. This demo script does some interesting stuff in sending a request back to Bridge, obtaining the list of selected files and reporting them to the user. For users, scripts such as these are the easiest since they just do a normal click and the script takes care of everything.

2. ah_bridge_batchfiles_test.js: target Photoshop

Select a couple of image files in Bridge and try running this first with shift-click and second with Ctrl or Cmd click. It will open the image in Photoshop, tell you the file name and full path and then in the first case close the images, in the second case leave the images open.

3. ah_bridge_sendfiles_test.js: target Bridge or Photoshop

This should work on all the CS apps. Use Shift-Ctrl-click or Shift-Cmd-click. All the test script does is report the list of files currently selected in Bridge from the target app. However any proper script would then be able to use that list of files to work on as required.

That is a lot for now, I'll fill in the gaps later.

[Note for people coming to download the script who have not read the whole thread:

After many weeks of work AH Bridge Launch 2 is released as a beta. This script is far more powerful than my Dynamic Scripts Menu which you find in this thread, but in fact the two scripts are quite complementary and the coexist fine. I suggest you check out both threads before deciding what you want to download.

bb/viewtopic.php?t=293 ]

Andrew
Mike Hale

AH Dynamic Scripts Menu for Bridge

Post by Mike Hale »

Andrew,

This is great!. I was using your ahbatch scripts. This seems faster. I did have one question. On my system, I can't run the scripts from the main menu bar. They run fine in the pop-up menu. Should it work either way? I'm using XPhome.

Thanks for these great scripts,

Mike
Andrew

AH Dynamic Scripts Menu for Bridge

Post by Andrew »

Thanks Mike, it was a bug that crept in with my last edit, I've fixed it and posted version 1.01. Please report any other bugs.

Andrew
Mike Hale

AH Dynamic Scripts Menu for Bridge

Post by Mike Hale »

Wow, That was fast. So far I havn't had anymore trouble. I have been using it to batch selected files. It's been working great. I almost don't miss the old file browser any more.

As you are open to feature requests, is there any way it could return you to Bridge when the script/batch is done? I have been using it for several hours now and it's great as is. I'm still learning js, so if this is a stupid request please disregard.

Mike
Andrew

AH Dynamic Scripts Menu for Bridge

Post by Andrew »

Version 1.02 released, this reverts to Bridge in Batch Open / Close mode (shift+click), good idea Mike.

I'm going to have a quick look at adding actions for batch mode today.

Andrew
Andrew

AH Dynamic Scripts Menu for Bridge

Post by Andrew »

Version 1.03 allows you to add photoshop actions to the list. Note: actions that try to run scripts will NOT work.

Normally you would run these in batch mode, even if you only have one file selected. The run options work exactly as for scripts (except the pass-files option does not apply):

1. Ordinary left-click: runs the action without regard to the Bridge selections.

2. Shift+left-click: opens the first selected file, runs the action, closes the file saving changes, opens the next file etc.

3. Ctrl/Cmd+left-click: same as 2 but does not close the file. This allows you to include a 'save-as' command at the end of your target action which will be helpful sometimes.

Vesion 1.031 Bridge menus go haywire if there are multiple items with the same ID, version 1.031 prevents this from happening.

Andrew
Mike Hale

AH Dynamic Scripts Menu for Bridge

Post by Mike Hale »

Andrew,

Is it possible to send argumenents to the script?

We create a lot of files usning data sets. It's fast, but some of the files need adjusting. The way I do that now is select the file in bridge, run an action that transform the layer with dialog on. I move and/or scale the layer. When I finish the transform, action saves and closes the file and the next loads.

If I could send argumenenents, I could(hopefully) create a script where I can select the images, choose the script to run and send it 110,-150.,75 The script use the first as the zoom value and the rest as the are for translate layer.

Thanks agian,
Mike
Andrew

AH Dynamic Scripts Menu for Bridge

Post by Andrew »

Hi Mike, do you use the same set of arguments for a whole batch of images. It would not be difficult to send arguments with some special routine but it seems to me that from a structure point of view it would be more sensible for the manual input of arguments to be included in the target script itself (a dialog that would appear as soon as you get to your target app). If you needed some help with that I could provide it.

Andrew
Mike Hale

AH Dynamic Scripts Menu for Bridge

Post by Mike Hale »

The short answer is yes. I can give details if you think there still might be a better way.

I thought of having the script ask for the information. I use the shift click batch mode. Would my script ask for each image or each batch? I thought in batch mode, it ran the script over and over again untill it had gone thourgh the list of files. Does that mean the script I run from your menu will ask for input over and over? If I'm wrong abuut that I will give it a try.

I'm starting to feel like you are writting this just for me, if you think that no one else would need to do this I undestand and thank you for what you have done so far.

Mike
Andrew

AH Dynamic Scripts Menu for Bridge

Post by Andrew »

Hi Mike

There is nothing more useful in developing a script than a user who works with it and provides feedback and suggestions. I consider you a contributor not a 'user'.

You're right on the batch thing. Let me have a fiddle and see what I can come up with. I think I will make the Ctrl+Shift+Click a special option that opens a command window, from which we can provide various options for how to go forward including adding your command string. So on your end, lets say the command will come over as array ah_BatchDataAr. Shouldn't take long.

Andrew