Skip to main content
Inspiring
May 18, 2018
Answered

Bridge open Automator app via script

  • May 18, 2018
  • 4 replies
  • 1910 views

I have an Mac OSX Automator app that I would like to open from a custom Bridge menu item. The menu item is setup. How do I define the file path in a Bridge script and invoke the file open command? The Automator app resides in in a local directory and the idea is to avoid having to navigate to the file location through Bridge.  Can a Bridge script open a file that is not visible in the Bridge panes?

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer SuperMerlin

If the files are applications you want to run, the code would be on the lines of:-

var selectedFiles= Folder("/Users/chris.carey/Desktop/Get Some/").getFiles("*.app");

for(var a in selectedFiles){

    File(selectedFiles).execute();

}

Inspiring
May 19, 2018

Using Bridge CC in OSX I can navigate to the target file location select it, hit the return key, which launches the automator.app workflow.

The snippet below comes to close to what I am looking for. When I change the file extension to 'app' and the  bt.target = 'finder' the snippet fails.

Can the snipe be modified to work with finder or non Adobe applications?

#target bridge; 

var selectedFiles= Folder("/Users/chris.carey/Desktop/Get Some/").getFiles("*app*"); 

//check if selectFiles have the correct extension, if required 

function script(fileList){ 

    for(var a in fileList){ 

        open(File(fileList)); 

        } 

var bt = new BridgeTalk(); 

bt.target = "finder"; 

bt.body = "var ftn = " + script.toSource() + "; ftn(" + selectedFiles.toSource() +");";  

bt.send(4);

Stephen Marsh
Community Expert
Community Expert
May 19, 2018

Another option could just be to make an Automator Folder Action (hot folder/watched folder) and then you can just copy/move files to the folder for automated processing.