fmp12 Script Problem with ".fp7"
Alert! Alert! Alert! New Filemaker Extension can cause problems with old scripts when you convert! It's not a bug, it's a typical problem when converting to a new file format. In this case its the new file extension ".fmp12" and perhaps Filemaker engineers forgetting to include the extension with Get(filename)...
Perhaps you have scripts where you append the file type and were kinda lazy at the time, as I was. So I used:
Set $_filename to Get(filename) & “.fp7” so that I could use it to open files, etc.
These will not work in Filemaker 12 or maybe they will but not as you hoped. For instance I use this to create a backup but now my backup is not working as an fp7 file instead of fmp12. Oh Oh!
I have been having a problem with my backup script creating a copy and this may be the reason.
So, here’s a handy technique (and there are others) for determining the correct type of file extension based on the file you have opened and the version of Filemaker you are running.
But remember, maybe you do want to open an .fp7 file so this isn't a big issue and only one like mine where I want to make a copy of this 12 file.
In your start up script create this $$_variable.
Set $$_extension to “.” & RightWords ( Substitute ( Get(FilePath ); "." ; " " ) ; 1 )
This replaces the period with a space and adds it back at the beginning…
Or you could just use $_extension and add this as a local variable to your scripts.
Now you can replace all instances of “.fp7” with $$_extension and this should work in all future versions of Filemaker if the extension is changed, say to .fmp13 or .fmp14, etc.
The revised idea is:
Set $_filename to Get(filename) & $$_extension