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.

Opening external files not URLS

Featured Replies

Hi,

I have a database where I imported a list containing various several files from different applications I use.

I am tring to create a script which will allow me to open one of these file with its corresponding application.

However I am unable to do so from FMP I think I need to create an applescript where using the parameters I have in different fields of the db will tell the finder to open the file I choose.

I have the file name in my first field and the complete path in another, so I think in my script I need to tell applescript to open something like

/Volume/Pathfiled/Filename

is this a correct? ( I never used applescript so I don't know how)

Thanks a lot

Edited by Guest

Maybe the easiest way, since you've already got the file path in a Unix-like syntax, is to use the FileMaker Perform AppleScript step, using a calculation, using the do shell script "" command. The FileMaker calculation would look like this (weird stuff is to add quotes where needed, and escape spaces in the path (which Unix does not like).

"set unix_path to quoted form of "/volumes" & FilePath & """ & ¶ &

"do shell script "open " & unix_path"

You could create a calculation field, so you could see the result. Or you can just attach it directly to a button, as it's a single step script (but then you need the table occurrence with the field name; don't worry, it'll tell you).

Unix paths are case sensitive (unless it has options otherwise, and this one doesn't seem to). It will open with the default program, according to LaunchServices; much the same as telling the Finder to open the file.

If you want to open files with specific applications (different from the default), then you have 2 choices.

1. Use the above using the "-b" option with the "bundle_identifier" of the application,* or,

2. Rewrite the AppleScript calculation to tell the application to open it. You would need to recalculate the file path to be "Mac" style, ie.:

volume name:folder paths:file.ext

Let (

mac_path = Right ( Substitute ( FilePath; "/"; ":"); Length (FilePath) - 1);

"tell application "Preview"" & ¶ &

"activate" & ¶ &

"open " & Quote ( mac_path ) & ¶ &

"end tell"

)

The above is kind of pointless, as Preview is the default, but you get the idea; tell the application to open it; could be the Finder (but in that case the Unix is sorter).

*The bundle identifier of Preview is "com.apple.Preview", FileMaker's (10 Advanced) is "com.filemaker.client.advanced"

Open_wAS.fp7.zip

Edited by Guest
Added file

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.