This is a public Forum  publicRSS

Forum post

    Exploring the use of a $Path Variable in Scripts
    Forum post posted April 1, 2013 by PhilModJunk, last edited November 1, 2013 
    2981 Views, 13 Comments
    Exploring the use of a $Path Variable in Scripts

    I've been playing with an "exploration file" that helps Novice developers better understand how to work with file paths, containers and the many script steps that can use a $Path variable to access or create a different file at a different location each time that the script is performed.

    I created a .fp7 version for FileMaker 11 and earlier users. Then I converted it to .fmp12 format and added a bit more to it for exploring the external storage and "interactive optimization" data format features newly added with FileMaker 12.

    The download link downloads a zip file containing both versions of this file. You can download and then extract the file from the zip archive to use it.

    The file is fully unlocked, you can easily examine the scripts in the file to find examples of how a $Path variable may be used and there are a number of calculation fields that can extract file names and file and/or folder paths from a container field after a file has been inserted into it.

    You can also use this file to capture a valid file path to an existing file or folder on your computer for use in your own set variable script step for setting up your $Path variable. You can insert a file into a container field in the file and then copy and paste from one of the special calculation fields provided for that purpose. Syntax examples for combining the file path to such a folder with either a literal file name or one calculated from fields in your database have also been provided.

    A special thanks to Jim Gurley for reviewing the file on a Mac system and for offering a number of helpful suggestions for improving this file.

    Please post all follow up questions in the thread that referred you to this thread. This thread is old enough that comments posted to it will not pop it back up into recent items and thus, I am unlikely to notice comments posted directly to this thread.


    • rouelf

      Phil, I tried using the FilePathExtractor on my MAC, and fmpa12, it does not work. It works when I run it in Windows XP. But on OSX the layout does not show the text in the buttons, does  not show the tabs. That is weird. I re-installed FMP Adv 12, but still problematic, any suggestions ?

    • Kitchenscapes


        works on PC, but cannot see scripts as it says unmodifiable.  Had ques on this very topic. tks...

    • Kitchenscapes

      Got it open, tks. Answered my ques before I asked...

    • Jim Gurley

      @rouelf  I run MacOS 10.7.5 and FMP adv 12.v3 and find no problems.  The only Layout show all tabs and buttons have great text alignment.  I am not sure what is causing  your problems.  I suspect it may be your Fonts.  My Mac look shows that Phil used Arial 12pt Bold for the most part and 10pt for a few labels.

      @Phil I downloaded your link dropbox version to double check on corruption.  All is good for me.yes


    • PhilModJunk

      In Mac OS systems, there's a known issue where a duplicate or damaged font suitcase can cause what you describe.

    • rouelf

      Thank you both for your responses. i checked the fmp7 version on my MACK and aloso misses up, no text, no tabs and other stuff. I use fmp adv 11 and 12, with OSX 10.3.8. 

      Will check see how to find errant font, or ..... re-install OSX ?

      Thanks again.

    • Dillip Kumar Mahapatra

      I have opened this file in my Mac OS 10.7.5 with FMP 12.0v1 and it works good. yes

    • rouelf

      OK, I used the procedure in this link: (had forgotten about this, probably a good thing to do periodically). to restart the MAC, it did not help with the font issue. So I changed the font, that works, but changing the font back to Arial messes things up. So at least this font is messed up on my MAC.

    • Jim Gurley

      Use Mac Font manager on Arial Font on your computer.  It will find damaged fonts and correct them for you.yes


    • Boris Kamp

      Thanks Phil! I reply here because you redirected me to here from here

      I have checked your file given above and understand that I need to use the $path with exporting field content, but then I do not understand how to make the file open by a PDF viewer either on MAC or Windows.

      Im currently working on my own Mac to build the database, when finished the database will be moved to a server so the file paths are not correct for now.

      Can you explain more specific how to create a script to export and open either a pdf, excel or whatever file?