Sounds like you entered "$StoryID" instead of $StoryID. (Remove the quotes.)
Thanks Phil, I had done that but left the .fp7 on the end of the name, which meant filemaker kept adding the quotes automatically. Chop the .fp7 off and it now works
Hmm - I just tried this, but selected Excel Workbooks.xlsx as the file type in the pop up instead of FMP.
If I leave off the .xlsx in the file name, the computer doesn't recognize the file type and can't open the file (last step in my script is to open the file), so it saves a blank icon file.
If I add the .xlsx to the file name, it names the file "$Field name.xlsx".
Is this because of Windows (7) vs Mac, or because of Excel vs FMP as the export file type?
Use Set Variable to assign the ".xlsx" as part of the value of the variable instead of putting it on the end like this.
Using the "specify" button to set the variable value -
File Receiver::Material Code & ".xlsx", still names the file as the name of the variable.
What am I missing?
If it matters - FMP 12, Windows7, hosted FMS 12
The script steps should look like this:
Set Variable [$Path ; value: Get ( DocumentsPath ) & YourTable::YourField & ".xlsx" ]
Export Records [no dialog ; “$Path” ; Add ; Windows ANSI ]
Note that $Path is not entered in quotes in the Export Records step though it is displayed in quotes in your script editor.
For more on $Path variables and the scripts that can use them, see: Exploring the use of a $Path Variable in Scripts