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.

Putting a variable fileame into an Open[] statemen

Featured Replies

  • Newbies

Hi,

In my database I have a field that holds a filename for another FM database. This name is different between records. I'd like to run a script that takes that filename and places it into an Open[] statement to automatically open that file. My problem is that Open[] seems not take an entry other than by pointing to a filelist.

Any ideas please.

Hi Dave,

DaveC said:

My problem is that Open[] seems not take an entry other than by pointing to a filelist.

That's right, out-of-the-box, FM doesn't provide the functionality you're looking for.

However there are several ways to achieve the outcome you're looking for.

One is to use the Open URL script command and then ensure that the default browser is configured appropriately to deliver the desired effect.

Another is to use snippets of VB or AppleScript (depending on what platform you're on), embedded in a script (using the 'Send Message' or 'Perform AppleScript ' commands) to open the relevant file.

Last but not least, you could use any of several excellent third party plug-ins (eg Troi File, DialogMagic. LaunchIt etc) which provide the capability to dynamically launch a file via script. wink.gif

An old plain FileMaker way would be to construct a script with If statements. If you're dealing with a limited known group of files this will work. You say the name is in the records, but you don't say how many files. Probably too many.

If [ some field = "donuts" ]

Open [ "Donuts.fp5" ]

Else

If [ some field = "cookies" ]

Open [ "Cookies.fp5" ]

End If

End If

In the past I have used Troi File plugin for this, as well as (on the PC) doing the following:

writing a calc that had the contents of a .bat file, which included a statement to open the relevant file, then writing a script that exports that calc field to a file called x.bat, and launching it via the "send message" script step.

Using the Satimage OSAX from http://www.satimage.fr/software/en/index.html you can completely script file-open dialogs, including your desired starting point. For instance:

copy "MyDisk:SomeFolder:Subfolder:" to startFolder

navchoose file starting at alias startFolder

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.