Copy link to clipboard
Copied
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?
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();
}
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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();
}
Copy link to clipboard
Copied
Absolutely, that works, thank you for your suggestion! I am able to run the automator app from the Bridge menu now which lays out the folder structure new projects. Many thanks!