StephenWonfor

Slight behaviour change in Export Script Step FMP 11, 12, 13 and 14 OS X

Discussion created by StephenWonfor on Nov 24, 2015
Latest reply on Nov 24, 2015 by keywords

Hi

 

OS X, by default, hides file extensions.  I have always tried to remember to append the correct extension when doing Variable driven exports.  A client has reported that some routines he has used for years have stopped working - exports to Excel.  Recently upgraded him from FMP 13 to FMP14.  It would seems that, by sloppy coding on my part, that failing to append the "xlsx" file extension will create an unusable file when run in FMP 14.  After testing I note that FMP 12 and 13 will create a useable Excel file without my adding the file extension.  FMP 14 creates an odd, empty text edit file.  Even odder with an export to Filemaker fmp12 format.  FMP 12, 13 and 14 will create, without the explicit extension, a file that opens in Font Book.  With the extension I get a normal FMP12 database.  Btw - I am running 10.9.5, he is running 10.10.x.

Testing then got out of hand.  Pasted the code into an FMP11 database (changed fmp12 to fp7) and it all works with or without the extension being specified.

 

The lesson is, I suppose, "Code What You Mean And Not What You Assume."

 

Set Variable [ $Version; Value:Int(Get ( ApplicationVersion )) ]

#Desktop has 4 folders - 11, 12, 13, 14

#Excel is set in the Export filetype

Set Variable [ $Output; Value:Get ( DesktopPath ) & $Version & "/SomeFile_01" ]

Export Records [ File Name: “$Output”; Automatically open; Character Set: “Unicode (UTF-16)”; [ No dialog ]

 

Set Variable [ $Output; Value:Get ( DesktopPath ) & $Version & "/SomeFile_02" & ".xlsx" ]

Export Records [ File Name: “$Output”; Automatically open; Character Set: “Unicode (UTF-16)”; [ No dialog ]

 

#Filemaker is set in the Export filetype

Set Variable [ $Output; Value:Get ( DesktopPath ) & $Version & "/SomeFile_03" ]

Export Records [ File Name: “$Output”; Automatically open; Character Set: “Unicode (UTF-16)”;[ No dialog ]

 

Set Variable [ $Output; Value:Get ( DesktopPath ) & $Version & "/SomeFile_04" & ".fmp12" ]

Export Records [ File Name: “$Output”; Automatically open; Character Set: “Unicode (UTF-16)”; [ No dialog ]

 

Stephen

 

 

"There are two ways to write error-free programs; only the third one works."~Alan J. Perlis

Outcomes