activeDocument.saveAs opens dialog

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

dpaintArexx
Posts: 4
Joined: Tue Nov 14, 2023 12:11 pm

activeDocument.saveAs opens dialog

Post by dpaintArexx »

Hi everyone,

I use activeDocument.saveAs() supplied with a File- and psdSaveOptions object. It works fine and silently when saving to a local hard disk.

But when the file object points to a network drive, I am greeted with a "Save As"-dialog. Any clues to why this happens?

Code: Select all

var networkFolder = new Folder("/Volumes/home/Projects/...")
networkFolder.exists // returns true
var fileObject = new File("/Volumes/home/Projects/.../myFileName.psd")
fileObject.exist // returns false (obviously, as it has not been created yet)

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

dpaintArexx
Posts: 4
Joined: Tue Nov 14, 2023 12:11 pm

Re: activeDocument.saveAs opens dialog

Post by dpaintArexx »

I did found a workaround:

Code: Select all

var localFile = new File("~/Desktop/localFile.psd");
var networkFile = new File("/Volumes/home/Projects/networkFile.psd");
activeDocument.saveAs(localFile, myPsdSaveOptions, true);
localFile.copy(networkFile);
User avatar
Stephen_A_Marsh
Posts: 37
Joined: Sun Aug 04, 2019 12:37 pm

Re: activeDocument.saveAs opens dialog

Post by Stephen_A_Marsh »

I would class your "workaround" as the preferred method, considering the following:

https://helpx.adobe.com/au/photoshop/kb ... oshop.html

P.S. Native OS move commands called from a script are discussed here:

https://community.adobe.com/t5/photosho ... 869/page/2
dpaintArexx
Posts: 4
Joined: Tue Nov 14, 2023 12:11 pm

Re: activeDocument.saveAs opens dialog

Post by dpaintArexx »

Oh, yes, that makes sense. Thanks for pointing me to those articles.

The test localFile.copy(networkFile) was done with a fairly small dummy psd, so I will try to use system-calls if problems occur on larger files.