Skip to main content
Known Participant
November 8, 2014
Question

Can an Illustrator Action be batched out of bridge?

  • November 8, 2014
  • 1 reply
  • 1775 views

I'm looking for a way to automate an Illustrator action. I can do batch out of ILL. But was wondering if the Action can be run on a selection of images out of Bridge?

Thanks

Max

This topic has been closed for replies.

1 reply

Stephen Marsh
Community Expert
Community Expert
October 24, 2015

It is possible to hard code an Illustrator action into a script. You then need to get the script into Bridge’s Tools/Illustrator menu and to then get it work correctly from Bridge (easier said than done, you may need to add specific Bridge code).

Pedro Cortez Marques
Legend
October 26, 2015

I'm sending the code that works using photoshop (in this case to open DNGs from bridge in cameraraw)

All you have to do is to put illustrator code in the var 'psdMessage' and put target 'illustrator' on BridgeTalk

Here an example how it works on photoshop getting files from bridge thumbnails selection:

var dd=app.document;

// getting dng (if there isn't any thumbnail selected, it uses the selectAll dngs)

if (dd.selections.length == 0) {

    var f =dd.getSelection("DNG,dng");

    for (var all in f) {

        dd.select(f[all]);

    }

}

// build message to send to photoshop (in a string) via BridgeTalk >> if using illustrator, change the code to illustrators code (I can't help you in here, sorry)

var psdMessage = "var RawOptions = new CameraRAWOpenOptions; RawOptions.settings = CameraRAWSettingsType.SELECTEDIMAGE; ";

psdMessage += "RawOptions.bitsPerChannel = BitsPerChannelType.EIGHT; RawOptions.size = CameraRAWSize.MEDIUM; ";

psdMessage += "RawOptions.resolution = 300; RawOptions.colorSpace = ColorSpaceType.SRGB; ";

for (var psds in dd.selections) {

    psdMessage += ' app.open(File("' + decodeURI(File(dd.selections[psds].path)) + '"), RawOptions);';

}

//

dd.chooseMenuItem('OpenInCameraRaw');

// send to photoshop using BridgeTalk:

var openMessage = new BridgeTalk();

openMessage.target = "photoshop"; // here you need to use 'illustrator'

openMessage.body = psdMessage;

openMessage.send();

The second thing you need to do is choose where you want to have access to this in Bridge:

A) on a button using you own built pallet in Bridge (app.document.palettes)

B) on the content panel using top or bottom (app.document.navbars.filesystem.top)

C) by clicking a group of thumbnails using the right-click and selecting your action

D) by clicking a folder in the Folders subpanel using the right-click and selecting your action

You must choose.

Stephen Marsh
Community Expert
Community Expert
October 26, 2015

Thank you Pedro,

I have tried to follow your suggestions, however I am still getting an error with the script when I run Bridge: “The test-actionAction is not available in the test-set Set.”

The action is installed in: Macintosh HD/Library/Application Support/Adobe/Startup Scripts CS6/Adobe Bridge

The script is visible and ticked/active in Bridge/Preferences/Startup Scripts

The script works fine when it is run from say Illustrator/File/Scripts/Browse

The action set is loaded in Illustrator and the action is in the set.

The working code for referencing an action via JS follows:

// https://forums.adobe.com/message/8101549#8101549

// Set your action name and the set name that it belongs to here

var myAction = "test-action";

var mySet = "test-set";

//---------------------------------------------------------------------------------

try {

    app.doScript(myAction, mySet);

} catch(e) {

    alert("The " + myAction + "Action is not available in the " + mySet +" Set.");

}