Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Set File name with a Script Variable

Featured Replies

Can you or how would you have a dynamic file name in a Save As script step? Currently my db is backed up daily to the same named file. I've come to realize this is REALLY NOT a good way to do things. If My back up is corrupted it is my only copy. So I would like to save a copy of my files with a changing file name e.g. contacts942007.fp7; contacts952007.fp7, etc.

Any ideas, suggestions.

Thanks.

Firstly you should really be using FileMaker Server. If you are, the Save a Copy As command is disabled because FMS is responsible for backing up the files.

Read more in Wim's excellent document:

www.connectingdata.com/MoreBackups_v2.pdf

  • Author

Thanks Vaughn:

However, this is a stand alone app or a runtime app. I don't have fmServer. That's my next thing when I have an extra couple of thou to spend. :

Any other ideas?

I just bought a 500 gb USB drive. My LAN Server went last week. Both HD's are being replaced. I also lost my dev server, my WAN Server and my SQL server in the last month. It was time they were all about 6 - 7 years+ old. That's the fun of living in the TampaBay area of Florida. "The lightning capital of the world!" We call it "fireworks by God. :)"

Fortunately I had backUps, but, that's what got me to thinking about my fm files.

What I've just done, today, is set up a global field to hold the DayName. I then created 7 folders for each day of the week. So I made a script with 7 If statements. I was hoping there was a more elegant way to do this.

TIA

You declare your filepath as a variable using Set Variable.

It depends on where you save the backups and your OS, but, for example you can:

Set Variable [$filepath;Left( Get(FilePath); Length( Get (FilePath)) - 4) & Right(0 & Month(Get(CurrentDate));2) & "_" & Right(0 & Day(Get(CurrentDate));2) & "_" & Year(Get(CurrentDate)) & ".fp7"]

Then when you specify an output file for the Save As, you put in $filepath.

Save as a Copy[$filepath;compacted]

Gives you a file named "filename_09_04_2007.fp7" in the same folder as the file.

  • 2 months later...

I'm developing something in FM7 and have been trying to use a similar "Save As filename scheme" to archive my own backups as I develop the database.

I am assigning the path/filename to a global field. But, it won't recognize the field name when I use the field in the Save As script output. ....can I do this with a field or does the Save As only accept $Variables (of course only being available in FM8 and above)?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.