3 Replies Latest reply on Sep 9, 2016 3:31 PM by keywords

    Syntax for defined variable

    rtolliver

      I need help with identifing the correct syntax to save a report PDF to a folder on my decktop.

       

      I already have the script that will perform the basic functions I just need to fine tune the Set Variable step.

       

      Example of Set Variable:

       

      Set Variable [$Path; Value: "filemac:/Macintosh HD/Users/UFolder/desktop/Report Folder/"&"Report.pdf"]

       

      When I execute the script I get an error message:

      "Report.pdf" could not be created on this disk. Use a different name, make more room on the disk, unlock it or use a different disk.

       

      The database was on a locked but was copied to a development for testing.  The development machine is not locked and has more than enough room.

        • 1. Re: Syntax for defined variable
          David Moyer

          Hi,

          This worked for me as a test ...

          try setting a variable with

          Capture.PNG

          Then using it in the dialog

          • 2. Re: Syntax for defined variable
            philmodjunk

            Take a look at this function:

             

            Get ( DesktopPath)

             

            It will reliably return the precise path to your client computer's desktop no matter from which computer (mac or windows) you evaluate the calculation. It will also adjust for different users as needed. You can then append just the text needed to complete the file path that you need by specifying the folders actually located on your desk top.

             

            Value: Get ( DesktopPath ) & "Report Folder/"&"Report.pdf"]

             

            If that fails, put a file in the folder where you want to save your PDF. Insert this file into a container field using the "by reference" option. Then use GetAsText container field, to get the file path to the file--which will be the last Row of text returned by this function. (You'll get three rows of text separated by returns.)

            • 3. Re: Syntax for defined variable
              keywords

              It may be a permissions issue. You have to make sure the directory/folder has read/write permission for fmuser when you are saving a pdf by script.