4 Replies Latest reply on Apr 14, 2015 4:09 PM by ralvy

    Save Copy to Documents Folder



      Save Copy to Documents Folder


      Does Filemaker 13 allow the Save Copy script step to save a copy to a folder within my Documents folder, assuming I have properly formatted the filepath? I keep getting an error message saying the file can't be saved there. I'm working under Yosemite. I can do it manually from the File dropdown menu, but not via a script step.

        • 1. Re: Save Copy to Documents Folder

          Yes this should work. Are you using Get ( DocumentsPath ) to compute the documents path and set that text to a variable?

          Set Variable [$Path ; Get ( DocumentsPath ) & "FileNameHere.fmp12" ]

          • 2. Re: Save Copy to Documents Folder

            I tried it both these ways:

            Set Variable [$Path ; Get ( DocumentsPath ) & "Subfolder1/Subfolder2/FileName" ]


            Set Variable [$Path ; "filemac:" & Get ( DocumentsPath ) & "Subfolder1/Subfolder2/FileName" ]

            Neither worked. Perhaps it fails because it's two level deep inside the Documents folder. I'll experiment with this tomorrow. I may have to resort to scripting Troi File moving the file to that folder.

            • 3. Re: Save Copy to Documents Folder

              The basic syntax that your are using is correct. becareful both to correctly specify the file extension and make sure that your sub folders actually exist inside the documents folder and are correctly named in your file path.

              You can also see this thread: Exploring the use of a $Path Variable in Scripts

              To get a file that you can use to check file paths. You can open this file and use insert file with the "by reference" option enabled to insert a file from your intended destination into a container field. Then check the calculation fields that return a file path extracted from the container field. You can compare the resulting file path to what you are using in your script.

              • 4. Re: Save Copy to Documents Folder

                Silly mistake on my part. I had forgotten to change the target of the Save Copy As script step to just a variable. It had previously been a mixture of a file string plus variable, and I had switched to using just a variable and forgot to update that one line. It's all working fine now.