Jump 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.

Featured Replies

I wrote a filemaker pro 7 database program for my wife's practice. I wanted to create backups of the database for each time she changed something. Ideally I would keep only the last 2 months of backups and delete the rest. Since you can only make a file "Database Copy.fp7" from within Filemaker pro 7, I thought I would write an Applescript that could be called from within filemaker. I would set filemaker pro to call a filemaker script at shut down that would first make a generic backup of the database "Database Copy.fp7" in a backup folder "clientbackups". Then the filemaker pro script would perform an applescript to rename the file with a date and timestamp. I would then have the applescript delete all the files in the backup folder that were older than 2 months. As another wrinkle since the database is used on a desktop and laptop computer that are synchronized I didn't want the Applescript to delete files created on the desktop when run on the Laptop and vis a versa. My solution was to have the Filemaker script determine if the database was being run on the desktop or the Laptop and run the Applescript designed for each computer. The major difference was that the Applescript would add "L-" before the database name if on the laptop or "D-" before the name if on the desktop.

The following is the filemaker script:

Save a Copy as [ "file:clientbackups/database Copy.fp7" ] [compacted copy (smaller)]

Pause/Resume Script [ Duration (seconds): 2]

If [ Get ( HostName ) = "Kevin desktop" ]

Perform AppleScript [ ]

Exit Script

End If

If [ Get ( HostName ) = "Kevin Laptop" ]

Perform AppieScript [ ]

Exit Script

End If

I am a novice at applescript but from searching Macscripter.com site I came up with the following is the Applescript for the laptop:

tell application "Finder"

set somedate to current date

set shortsomedate to short date string of somedate

set hrsomedate to hours of somedate as number

set minsomedate to minutes of somedate as number

set secsomedate to seconds of somedate as number

set the name of file "Macintosh HD:Users:AllynLaptop:Documents:Allyn Clients:clientbackups:ClientDatabase Copy.fp7" to "L-ClientDatabaseBKUP" & shortsomedate & " " & hrsomedate & "-" & minsomedate & "-" & secsomedate & ".fp7"

set thefolder to alias "/Users/AllynLaptop/Documents/Allyn Clients/clientbackups"

delete (items of thefolder whose creation date < ((current date) - (60 * days)) and name contains "L-")

end tell

for the Desktop I just substitute the desktop file path names and prepend "D-" to the backup file name.

I tested the filemaker script and had to add the pause script step or I got a applescript error that it couldn't find the backup file copy. Although the Applescript works fine when run as a stand alone applescript; when placed in the filemaker script I keep getting a out of memory error.

Do I need the applescript to tell filemaker to quit before I change the backup files name?

Any thoughts help or suggestions would be much appreciated

Kevin

Model: iMac G4 and ibook G4

AppleScript: 1.10.3

Operating System: Mac OS X (10.4)

Have you considered hosting the file with FileMaker Server? This solve both of your problems (e.g. easy automated backups, and no need to synchronize the files, since it's only a single file)?

  • Author

Thanks for replying. I did consider it, but didn't want the expense and headache of upgrading from Filemaker Pro 7. I am sure I can accomplish this with applescript it just needs tweaking, I hope.

  • Author

I was able to get it to work by putting a Pause script step after the perform applescript step. I am sure someone out there can show me a more elegant applescript.

Thanks for any help

Create an account or sign in to comment

Important Information

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

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.