I need to do the same so have done some experiments with Scriptmaker,
based on previous tips from this forum. First I created a global text
field called "filename" (this is needed because there does not seem to
be a way to "input" global variables like the $export that I use below).
Then I created the following script:
Show Custom Dialog [ Buttons: �OK�, �Cancel�; Input #1:
Vehicles::filename, "File name for saving (without XLS suffix):" ]
Set Variable [ $export; Value:"file:ancap_fm/REPORTS/" &
Vehicles::filename & ".xls" ]
Save Records as Excel [ File Name: �$export�; Records being browsed; Use
field names as column names ]
[ Restore ]
This asks the user for a filename, with a default of the current
filename field contents (You can use Set Field name to assign a default
value to the filename field). It uses the response to create a string
global variable ($export) that is used in the Save Records as Excel
command. This avoids the Save As window appearing.
As usual, there are probably a dozen other ways to do this...
Thomas Hansen wrote:
> I have a couple of scripts that save records in Excel or PDF format. In
> all of these scripts, I let the user decide where to save the file - and
> name it. But is it possible to change the default file name to something
> other than "Untitled.xls"? I tried entering a file name (withouth path)
> in the script, with result that Filemaker didn't display the file
> chooser dialog at all, it simply saved an Excel file with the name I had
> chosen in the app folder.
> The other thing I would like to do is to change the title of the file
> chooser dialog. It now says simply "Save Records as Excel" (or something
> like that). Can this be altered in some way?
> If none of these two things can be altered, then the user has no way of
> actually knowing what records are being saved (if running a script in
> which multiple files are saved) unless I update the background window
> with some information.
> I'm running FileMaker Pro 8 (not Advanced) on Mac OS X 10.4. (The
> database itself is running on a FileMaker 8 Server on Mac OS X Server