Hi,
I am using the code below to save a TextArea as a .txt file.
Is it possible to have the Window which opens up to be pre-defined with the OS X desktop as the default save location?
dim f as FolderItem = GetSaveFolderItem(FileTypes1.Text,"My Info")
dim txt as TextOutputStream = textoutputstream.Create(f)
txt.Write TextArea1.Text
txt = Nil
I know I can also use the code below:
Dim dlg as New SaveAsDialog
Dim f as FolderItem
dlg.InitialDirectory=SpecialFolder.Desktop
dlg.promptText="Prompt Text"
dlg.SuggestedFileName="Suggested Filename"
dlg.Title="Title Property"
dlg.Filter=FileTypes1.Text
f=dlg.ShowModal()
If f <> Nil then
Return True //file saved
Else
Return True //user canceled
End if
-
Which is the best way of achieving a default save location (snippet 1 or snippet 2)
-
Are the 2 Return True statements in the second code snippet required, as I do not need anything special to happen if the file is saved, or the user cancels.
-
Is it possible to allow the user to set an OS X tag on the file at the time of saving?
Thank you.