1 Reply Latest reply on Feb 19, 2015 6:31 AM by philmodjunk

    Problems with Script Step "Save as Copy" to Dropbox

    AdamHorne

      Title

      Problems with Script Step "Save as Copy" to Dropbox

      Post

      I want to add a simple startup script that saves a copy of my file to a Dropbox folder. I have two steps in my script:

      Set Variable and Save a Copy As...

      Set Variable: $file
          
          Let ( [
          
          $docPath = Get ( DocumentsPath ) ; 
          $dropPath= Substitute ( $docPath ; "Documents" ; "Dropbox" ) & "BulldogInventory/Backups/";
          
          $name =timeStampHorne & "_" & Get ( FileName ) & ".fmp12" 
          
              //timeStampHorne is a custom function that sets my date formatted 2015-02-19
          
          ] ; 
          
          $dropPath & $name
          
          )


      Save a Copy As ["$file";copy]


      Everything looks good in the debugger until it tries to save and I get an error saying I don't have permission to save... Error 800

      The script works fine trying to save to my Desktop, just not Dropbox and I'm wondering why.

      Can someone inform me?

        • 1. Re: Problems with Script Step "Save as Copy" to Dropbox
          philmodjunk

          What is the exact text of that error message?

          Is the file local to your computer or one that is hosted over a network from another machine? (Can't save a copy from a hosted file...)

          There's a generic error message that pops up when FileMaker tries to create a new file and can't. Its text tends to be misleading as the most common cause of an error is some picky little error in the specified file path that renders the path invalid. That might be the source of your trouble here.

          Error Code 800 "unable to create a file on disk"

          is consistent with that possible issue here.

          Here's a way that I use to check file paths: Download the file found in this thread: Exploring the use of a $Path Variable in Scripts

          Open the file and insert a file from the location to which you want to save a copy into the container field with the "by reference" option specified. Then compare the file path that your script is calculating to the file path extracted by calculation fields from the container field to see if you can spot the difference in file paths.

          I have also observed that the precise File path to Drop box is not identical from computer to computer due to differences in OS version.