• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Bridge open Automator app via script

Engaged ,
May 18, 2018 May 18, 2018

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?

TOPICS
Scripting

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , May 19, 2018 May 19, 2018

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();

}

Votes

Translate

Translate
Engaged ,
May 18, 2018 May 18, 2018

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);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 19, 2018 May 19, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 19, 2018 May 19, 2018

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();

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 19, 2018 May 19, 2018

Copy link to clipboard

Copied

LATEST

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines