2 Replies Latest reply on Jun 8, 2015 2:24 PM by MorkAfur

    Including a path in a PDF File Save Name



      Including a path in a PDF File Save Name


      I created a date with dashes using two Replace commands since FM didn't like the "/" in the disk file name. Cool, I rule!  Well, not yet. When I try to then prepend the path to the location I want the PDF to be created, FM won't process it.

      I try to set $outputFile variable like this:  "/Users/Me/Desktop/Open Issues Report - " & $dateWithDashes

      Then, the Save As PDF just references the $outputFile variable.

      Except that it doesn't work.

      (If I strip off the /Users/Me/Desktop/" piece, it will create the PDF, but in the wrong place.)

      Wondering how to get this to work...




        • 1. Re: Including a path in a PDF File Save Name

          I'd use substitute to replace the / with - as it's simpler.

          is this a mac or windows system? For a windows system, I'd expect to see a drive letter at the beginning.

          The bets option is to use Get ( DesktopPath ) to compute the path to the desktop for you and this function can return different paths on different computers or when a different user account was used to log in.

          A while back I created a file that you can download from here: Exploring the use of a $Path Variable in Scripts

          It can be very helpful in debugging these kinds of situations because you can use Insert File with the "store a reference" option to insert a file from the destination to which I want to save new files. There are calculation fields in this file that will then extract valid file paths and file path expressions from the file reference to the inserted file. I can compare these to my scripted expression or even copy/paste text from the field into my set variable step to be sure that every detail of my file path is exactly correct.

          • 2. Re: Including a path in a PDF File Save Name

            Thanks Phil!

            Get(DesktopPath) worked great!

            It creates: /Macintosh HD/Users/me/Desktop/

            I didn't have the first part.


            - m

            P.S. I'll use substitute next time.