Does File.saveDialog() allow default name?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

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?
Yenaphe
Posts: 84
Joined: February 3rd, 2009, 6:30 pm
Location: Paris - France
Contact:

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.
Yenaphe
Posts: 84
Joined: February 3rd, 2009, 6:30 pm
Location: Paris - France
Contact:

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);
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

Yes, kudos indeed to Jeff. ;)
Post Reply