Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do I insert Windows Environment Variables (%USERPROFILE%) as a file path for exports?

Featured Replies

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

 

Solved by No_access

Go to solution
  • 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 )
  • 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

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.

  • 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!

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.

  • 1 year later...

 

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.