Group Abstract Group Abstract

Message Boards Message Boards

defining the default directory in FileNameSetter

POSTED BY: Matty Mookerjee
2 Replies

Henrik

Yes, that works. Actually, it works better because the user, if they decide to type the file name, no longer has to put it in quotation marks (which they often forget to do).

I was really stuck on it having to be an option in FileNameSetter; I didn't think about how I could change something in the DialogInput.

Thank you so much.

Matty

POSTED BY: Matty Mookerjee

Is it this you are looking for?

DialogInput[{filename = FileNameJoin[{$HomeDirectory, "Desktop"}]}, 
 Column[{"Either type your file name (in quotation marks and with the \
file extension) or browse for your file:", 
   InputField[Dynamic[filename], String, 
    FieldHint -> "Enter your file name"], 
   FileNameSetter[Dynamic[filename], 
    "Open", {"text files" -> {"*.txt"}}, Method -> "Preemptive"], 
   DefaultButton[DialogReturn[filename]]}]]

Henrik

POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard