1 Reply Latest reply on Sep 12, 2011 8:27 AM by philmodjunk

    Save copy as script not working

    GabeDiaz

      Title

      Save copy as script not working

      Post

      Hello,

      Hopefully this shouldn't be too difficult for you guys to figure out.

      I am trying to add a Save copy as call to the end of one of my scripts but it doesn't seem to be working.

      See the screenshot for the script, first I set a variable called $timestamp and then tell it to Save a copy as $timestamp.

      Here is copied text of the Variable part "file:Backups/" & Substitute(Get (CurrentTimeStamp) ; ":" ; "-") & ".fp7"

      As you can see in the screenshot, I get an error that it can't save.

      If I just tell it to save a copy as "file:/Backups/backup.fp7" it will work however, so I am guessing I must have something wrong in the part that sets the Variable.

      Can anybody see whats wrong?

      I greatly appreciate any help on this topic.

      Thanks!

      Picture_5.png

        • 1. Re: Save copy as script not working
          philmodjunk

          I use this expression with my Saving Sequential Back Ups During Development auto-back up system and it works for me:

          Let ( [ F = Get ( FilePath ) ] ;
                  Left ( F ; Position ( F ; "." ; Length ( F ) ; -1 ) - 1 ) & " " & Substitute ( Get ( CurrentTimeStamp ) ; ["/" ; "-"] ; [":" ; " " ] ) & ".fp7"
                ) // Let ]

          Note that it removes both : and / character's from the filename, both of which can be illegal in a file's name. It also computes a file path to the same folder as the current file and appends the time stamp data to the end of the file name, but before adding the ".fp7" file extension.