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.

Strange behavior creating alias.... long post!

Featured Replies

I’m having strange problems with this “Restore Backup File” routine – any help would be appreciated!

My main database file is named “ISM Program.fp8” (I know .fp8 is not standard, don’t even ask why I have to use this..!). Each time the database is closed it saves a copy of itself named “ISM Data Backup” (no extension). This is the folder set up: (omitted HD & username, this runs on multiple computers with multiple usernames, that’s why I’m using “DesktopPath” in the AppleScript)

Main database = Users:Applications:ISM Stuff:Safety Management System:ISM Program.fp8

Backup #1 = Users:Applications:ISM Stuff:Backup:ISM Data Backup

Other Backups = Users:Applications:ISM Stuff:Safety Management System Backup:Monday:ISM Data Backup

---Tuesday:ISM Data Backup

---Wednesday:…and so on

The database Startup script checks to see if it’s filename is

“ISM Data Backup” & if it is goes to a Restore layout with options to “Restore” or “Cancel”. If the user chooses “Restore”, the following script runs:

Note: all applescript is “native”

.....

..Set Variable $PathFile = Left ( Get ( DesktopPath ) ; Length (Get ( DesktopPath )) - 8) & "Applications/ISM Stuff/Safety Management System/ISM Program.fp8"

..Save a Copy as [$PathFile ; compacted]

This applescript deletes the existing alias (on the desktop) to the ISM Program.fp8 file being replaced.

.. Perform AppleScript

.. tell application "Finder"

.. if exists fIle "Logs & Forms" of desktop then Select file "Logs & Forms" of desktop

.. delete file "Logs & Forms" of desktop

.. end if

.. end tell

Then this makes a new alias on the desktop to the new

“ISM Program.fp8” file.

.. Perform AppleScript

.. set ISMFile to (path to home folder) & "Applications:ISM Stuff:Safety Management System" as string

.. tell application "Finder"

.. make new alias file at desktop to file "ISM Program.fp8" of folder ISMFile

with properties {name:"Logs & Forms"}

.. end tell

.. Close File [Current File]

.......

All this is working as intended: If the user navigates through Finder to one of the ISM Data Backup files and double-clicks it starts, sees that it’s name is ISM Data Backup, saves a copy (or over-writes) as ISM Program.fp8, deletes the old alias and creates a new one to the correct file.

Now to the problem: I created another applescript (saved as .app on the desktop) as below:

.. set BackupPath to (path to home folder) & "Applications:ISM Stuff:Safety Management System Backup" as string

.. set StartFolderForSelection to alias BackupPath

.. tell application "Finder"

.. set FileToOpen to choose file with prompt "Open a Day Folder and select an ISM Data Backup file to Restore:" default location StartFolderForSelection without invisibles

.. open file FileToOpen

.. end tell

This shows a file open dialog so that the user can choose a backup file instead of having to navigate there manually. This also works – shows the dialog and runs the file chosen, which runs the startup script and executes the applescript to do the aliases. I can navigate manually to any one of the backup files & open repeatedly with no problems, but if I run the “choose file” applescript I get a “File not found” error (the file has been created, the applescript is not finding it..!).

What would be the difference between navigation manually and running this applescript? I’m setting an explicit path in the “make new alias” statement, but guessing that something is changing this path somewhere. I’m at a loss..!

  • Author

Update on above message. tried just creating an alias to the folder containing the daily backup files - user opens the folder, double-clicks on an ISM Data Backup file and filemaker starts, saves a copy and runs the applescripts to do the aliases. This has been working but now is not! Works sometimes, though. Now what..!!

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.