Page 1 of 1

Does File.saveDialog() allow default name?

Posted: September 15th, 2009, 1:04 pm
by vfxman
This is copied straight out of the Javascript Tools CS4.pdf. I'm curious if there is a misprint (which has happened in the past) on the syntax.
saveDialog()
File.saveDialog (prompt[, preset])
——————————————————
prompt_____A string containing the prompt text, if the dialog allows a prompt.
filter_______Optional, in Windows only. A filter that limits the types of files displayed in the
dialog. A filter expression, such as "JavaScript:*.jsx;All files:*.*"

_____________Not used in Mac OS.

Opens the built-in platform-specific file-browsing dialog in which a user can select an existing file
location to which to save information, and creates a new File object to represent the selected file
location.

If the user clicks OK, returns a File object for the selected file location. If the user cancels, returns
null.
filePutDialog() Allowed for a default name in the save dialog window like so...

Code: Select all

filePutDialog(Title, Default Name, Extension Filter);
Where as File.saveDialog() doesn't seem to...

Code: Select all

File.saveDialog (prompt[, preset])
The preset spot in the brackets leads me to believe that the default name would go there like

Code: Select all

File.saveDialog (prompt[, Default Name])
Only it doesn't work. I've tried a few combos and nothing. The definitions in the pdf only mention filter not preset. Is this not possible with the latest formatting?

Re: Does File.saveDialog() allow default name?

Posted: December 7th, 2009, 3:40 pm
by Yenaphe
I'm updating my scripts with the .saveDialog() and I have the exact same question.

I'm sure the answer is yes, just need to figure out how to do this.

Re: Does File.saveDialog() allow default name?

Posted: December 8th, 2009, 2:59 am
by Yenaphe
Kudos to Jeff Almasol pointing me into the right direction to do this:

var TmpFile = new File("The default name you want");
yourFile = TmpFile.saveDlg(aruments);

Re: Does File.saveDialog() allow default name?

Posted: February 17th, 2010, 6:40 pm
by vfxman
Yes, kudos indeed to Jeff. ;)