October 3, 201312 yr Hi All, Basically, I'd like to define my export script to just dump a pre-named file onto the user's desktop, regardless of their username. The best way I know of to get directly to a user's desktop would be to use the Windows Environment Variable %USERPROFILE%Desktop . However, FMP doesn't like when I use the Windows environment variable in the file path. I noticed that they have an example for "$Variable", but it looks like that's for Filemaker variables and not Windows environment variables. Is this possible and I'm just getting the syntax wrong? Or is there a different way to do this? Thanks
October 3, 201312 yr Solution Set as variable Let ( [ MAC = "filemac:" & Get ( DesktopPath ) ; PC = "filewin:" & Get ( DesktopPath ) ] ; Case(Abs(Get ( SystemPlatform )) = 1; MAC; Abs(Get ( SystemPlatform ))= 2 ; PC ) & $$FileName )
October 3, 201312 yr Author Thanks. So, I name the variable anything I want, while leaving your "$$FileName" in there? Or am I supposed to rename that to something else? Also, how do I format the export filepath once the variable is defined correctly? Should it look like this?: $VariableName/export.mer
October 3, 201312 yr No, the variable you use in the export dialog needs to contain the full path and file name. You can not use the export dialog as a calculation.
October 3, 201312 yr Author Ah, nevermind, figured out how it all goes. I named the variable "$$ExportPath", changed "$$FileName" to "import.mer" and just formatted the filepath as $$ExportPath. Works a treat! Much thanks!
October 3, 201312 yr You do not need to use global $$variables here - they hang around until you close the file. Use local $variables instead, to have them cleared automatically when the script exits.
April 2, 201510 yr Set as variable Let ( [ MAC = "filemac:" & Get ( DesktopPath ) ; PC = "filewin:" & Get ( DesktopPath ) ] ; Case(Abs(Get ( SystemPlatform )) = 1; MAC; Abs(Get ( SystemPlatform ))= 2 ; PC ) & $$FileName ) Thanks! this saved my day.
Create an account or sign in to comment