How can I get a system file save or file open dialog in Director?
There are a number of ways to get a file save and a file open dialog box in director. Here are the 4 most common. Note that the box does not open the file, it just returns the full path and filename.
FileIO
Open -
set myFile = new(xtra "fileio")
set theFile = displayOpen( myFile )
set myFile = 0 set myFile = new(xtra "fileio")
Save -
set theFile = displaySave( myFile, "Title", "Default File Name")
set myFile = 0
Buddy API
Open -
set theFile = baGetFilename("Open", "C:\", "Filename", "Filters|*.*", Flags, "Instruction", Allow Folder Selection, X-Location, Y-Location )
Save -
set theFile = baGetFilename( "Save", "C:\", "Filename", "Filters|*.*", Flags, "Instruction", Allow Folder Selection, X-Location, Y-Location )
FileXtra
Open -
set theFile = fileOpenDialog(initialDirectory, filterString, dLogTitle, createPrompt, FileMustExist)
--On the Mac, only the initial Directory and filterString are valid
Save-
set theFile = fileSaveAsDialog(initialDirectory, fileName, dialogTitle, overwritePrompt)
--On the Mac, only the initial Directory and fileName, and prompt are valid.
MUI Xtra
Open -
set aMuiObj = new (xtra "MUI")
set fileString = "Open this file"
set theFile = fileOpen(aMuiObj, fileString)
Save -
set aMuiObj = new (Xtra "MUI")
set fileString = "save this file"
set theFile = fileSave( aMuiObj, fileString, "with this prompt" )
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA