Script Function: Get(DesktopPath)

Posted in Scripts

When you are automating exports of user data from a FileMaker file, the easiest place for the user to be able to find the exported file at a later date is on the desktop.  How can you export a file there?  Using the Get(DesktopPath) script function!

It returns the path to the desktop folder with a trailing slash ready for you to append a filename to, for example:

$file = Get(DesktopPath) & “export.xml”

Would return something like ‘/C:/Documents and Settings/Username/Desktop/export.xml‘ on a Windows machine and something similar to ‘/MacintoshHD/Users/Username/Desktop/export.xml‘ on a Mac.

If you save it to a variable you can then use it in an export path to enable dynamic export paths to the user’s desktop, without having to know their platform and system username.

2 Responses to “Script Function: Get(DesktopPath)”

  1. Paul Says:

    Easy to get the desktop path in local variable, but you dropped the ball on how you get it into the export path. Please explain fully.

  2. Dempsey Says:

    Once you’ve created the variable, you can just use that in the file path calculation for the export

Leave a Reply