3 Replies Latest reply on May 25, 2011 11:56 AM by philmodjunk

    Save to subdirectory



      Save to subdirectory


      FM 11 Advanced. I’m trying to save a backup copy of the current FM file to a sub-folder named “backup” in the current directory. The following script steps saves to the desktop with the correct file name (stored in $path). However, I can’t figure out how to configure the Specify Output File dialog box in the Save a Copy As script step. It saves to the backup folder, but names the file $path, not the value stored in the script variable.

      Set Variable [ $path; Value: Let( t = Get(CurrentTimeStamp) ; Get(DesktopPath) & Get(FileName)& "_" & Year(t) & "-" & Month(t) & "-" & Day(t) & "_" & Hour(t) & Right( "00" & Minute(t) ; 2 ) & ".fp7" ) ]

      Save a Copy as [ “$path” ] [ copy of current file ]

      Any suggestions?

        • 1. Re: Save to subdirectory

          Exactly what do you see in the Specify Output File dialog for your save a copy as step?

          You should see $Path without any quotes or other text.

          PS. You mention a sub-folder, but your $Path variable does not receive the folder name of any such sub-folder. If you are going to put the path to the desktop and also the filename in this variable, you need to also include the names of any sub-folders.

          • 2. Re: Save to subdirectory

            What I see is:


            The file gets saved to the folder "backup" ok, but it's named $path, not the filename defined in $path!

            Isn't the Specify Output File dialog box used to designate the folderthat  the file is to be saved to? I really can't find a good explanation on how to use this dialog.

            Are you saying I should name the folder and it's path in the script variable $path?

            • 3. Re: Save to subdirectory

              I'm really suprised that anything gets saved here.

              A File path to a file includes all of the enclosing folders from the root directory down to the file what you seem to have put together combines the file path to the desktop with a relative path to a directory named backup that is stored at the same location as your databse file.

              I'd put the entire path into the variable as:

              Set Variable [ $Path ; "File:/backup/" & Let( t = Get(CurrentTimeStamp) ; Get(FileName)& "_" & Year(t) & "-" & Month(t) & "-" & Day(t) & "_" & Hour(t) & Right( "00" & Minute(t) ; 2 ) & ".fp7" ) ]

              Note that I've removed Get ( DesktopPath ) as it doesn't make sense in this calculation if the directory "backup" is located next to your current copy of the database.