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.

Script step for opening non-filemaker file?

Featured Replies

I have a layout with a container field that stores paths to jpeg files. I'm trying to write a loop script that works through a found set and opens all the referenced jpegs.

The 'open file' script step only opens filemaker files, as far as I can tell.

I have the rest of the script constructed, I just need to know how to request that a referenced file be opened.

Would appreciate any help.

Jon

I just need to know how to request that a referenced file be opened.

You can use Send Event or check out a plugin such as Base Elements.

  • Author

Thanks for the quick answer, Russell.

I didn't know what Send Event was for. Now I'm trying to figure out (without any programming knowledge, unfortunately) how to use it to actually find and open the relevant file. So far no luck. Any tips for this?

Thanks,

Jon

Two options you might look at are: the Export Field Contents script step, which has a checkbox preference to open the file after saving, look in the path options. Also look at the Open URL script step.

Now I'm trying to figure out (without any programming knowledge, unfortunately) how to use it to actually find and open the relevant file. So far no luck. Any tips for this?

Both methods would require you to set a variable containing your path to open the file. Search your Filemaker Pro Help for "Creating file paths".

Fitch mentioned two good methods too.

  • Author

Thanks both. Plenty to work on here.

  • Author

Hmm. According to Filemaker help, "variables are not supported in file paths that are stored in container fields". Will have to look at changing the field type, if I can do that without losing all the stored paths. Back to the drawing board...

Hmm. According to Filemaker help, "variables are not supported in file paths that are stored in container fields".

If you select Store only a reference to the file, one way to see the location of the file on your hard disk is to create a script using the Get(ActiveFieldContents) function.

I just need to know how to request that a referenced file be opened.

You could simulate double-clicking the container field as:

Go to Field [ Select/perform; YourTable::ContainerField ]






Alternatively - and IMHO, preferably - use the Open URL[] step with the following calculation =




Substitute ( GetValue ( YourTable::ContainerField ; ValueCount ( YourTable::ContainerField ) ) ; [ "file:/" ; "file://" ] ; [ "filemac:/" ; "file://" ] ; [  "filewin:/" ; "file://" ] ) 

This has the advantage of not activating the container field - in fact, it doesn't even need to be on the layout.

---

NOTE: if your container field stores a reference to an image (as apposed to a file), you'll need to adjust the above calculation to have the returned URL follow the file URI scheme.

Edited by comment

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.