Highlighted

Script run from Bridge saveAs brings dialog, works fine from Photoshop

New Here ,
Sep 15, 2020

Copy link to clipboard

Copied

I made this script to save files in various options and folders. 

It works fine when i run it from opened file in photoshop.

If i run it as batch from bridge, when it gets to the saveAs function, i get the saveAs dialog in photoshop, to chose the where to save.

Here is what i have now:

var doc = app.activeDocument;

saveTiffOriginal();

function saveTiffOriginal() { 

var folder_name = Folder(doc.path + "/Tiff - original");
//Check if it exist, if not create it.
if (!folder_name.exists) folder_name.create();

var file = new File(folder_name + "/" + doc.name);

var opts = new TiffSaveOptions();
opts.imageCompression = TIFFEncoding.TIFFLZW; 

doc.saveAs(file, opts, false);
}

 

It seems that when the file is opened from bridge, it relates to the doc differently, although when i do:

alert(BridgeTalk.appName), i get "photoshop" and not "bridge".

 

TOPICS
Actions and scripting

Views

22

Likes

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

Script run from Bridge saveAs brings dialog, works fine from Photoshop

New Here ,
Sep 15, 2020

Copy link to clipboard

Copied

I made this script to save files in various options and folders. 

It works fine when i run it from opened file in photoshop.

If i run it as batch from bridge, when it gets to the saveAs function, i get the saveAs dialog in photoshop, to chose the where to save.

Here is what i have now:

var doc = app.activeDocument;

saveTiffOriginal();

function saveTiffOriginal() { 

var folder_name = Folder(doc.path + "/Tiff - original");
//Check if it exist, if not create it.
if (!folder_name.exists) folder_name.create();

var file = new File(folder_name + "/" + doc.name);

var opts = new TiffSaveOptions();
opts.imageCompression = TIFFEncoding.TIFFLZW; 

doc.saveAs(file, opts, false);
}

 

It seems that when the file is opened from bridge, it relates to the doc differently, although when i do:

alert(BridgeTalk.appName), i get "photoshop" and not "bridge".

 

TOPICS
Actions and scripting

Views

23

Likes

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
Sep 15, 2020 0

Have something to add?

Join the conversation