Skip to main content
Inspiring
August 14, 2017
Answered

is there a document "SaveAs" function using JS

  • August 14, 2017
  • 2 replies
  • 1783 views

hi there,

understand that Save is different from SaveAs function but i could not find the "SaveAs" function using javascripingt.

There's a Save and saveACopy function but not saveAs.

Is saveACopy equivalent to SaveAs? what's the difference between the two?

Thank you.

Cheers

This topic has been closed for replies.
Correct answer Jongware

The difference is mentioned in the comments of the to:File parameter for these two functions.

save ("Save the document"): Where to save the document. If the document is already saved, a copy is saved at this path, the original file is closed the new copy is opened

saveACopy ('Saves a copy of the document"): The file path for the copy. Note: Leaves the original document open and does not open the copy

(my emphasis)

TLDR: "save" without a "to" parameter is the UI's "Save" menu command. "save" with a "to" parameter is the UIs "Save As" menu command. "saveACopy" is the UIs "Save a Copy" menu command.

2 replies

Jongware
Community Expert
JongwareCommunity ExpertCorrect answer
Community Expert
August 14, 2017

The difference is mentioned in the comments of the to:File parameter for these two functions.

save ("Save the document"): Where to save the document. If the document is already saved, a copy is saved at this path, the original file is closed the new copy is opened

saveACopy ('Saves a copy of the document"): The file path for the copy. Note: Leaves the original document open and does not open the copy

(my emphasis)

TLDR: "save" without a "to" parameter is the UI's "Save" menu command. "save" with a "to" parameter is the UIs "Save As" menu command. "saveACopy" is the UIs "Save a Copy" menu command.

Inspiring
August 15, 2017

thanks for the reply..

I do know that SaveAs is better than Save but i can't find the AsSave function using JS?

(There's Save and saveACopy function not SaveAs)

Inspiring
August 15, 2017

From the object model viewer:

Document.save (to: File , stationery: Boolean , versionComments: string , forceSave: Boolean ): Document

Adobe InDesign CC 2017 (11.0) Object Model

Save the document

to: Data Type: File

Where to save the document. If the document is already saved, a copy is saved at this path, the original file is closed the new copy is opened (Optional)

When you omit [to] you do a Save. When you specify a [to] you do a Save As