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.

Open PDF file (filename stored in field) (Mac)

Featured Replies

I have a bunch of differently named PDF files, each corresponding to a record in an FMP 7 database (Mac) called "testinglinks". For each record, in addition to providing data relating to the corresponding PDF file, I want to be able to open that particular uniquely named PDF file via a scripted button based on the field containing the PDF file's unique filename. The name of that field is "testinglinks:imagefile".

I have tried using a calculated Send Event utilizing the PDF default application Preview to no avail, even after playing with pathnames ad naseum.

I have also made a rough attempt using lots of variations on a calculated AppleScript, again meeting failure. Those attempts spring from the following suggestion by Fenton:

"tell app "Finder"�" &

"open " & """ & testinglinks:imagefile & ""�" &

"end tell"

It does not seem to matter where I place the PDF file(s) on my local drive, including at the top level, on the User's Desktop, in the FMP7 folder, or anywhere else.

Suggestions? Thanks.

when you use the Open command, you need to put the full path to the file there. So it would be like

"tell application "Finder"

open "Macintosh HD:" & testinglinks::imagefile & ""

end tell"

The only other thing i can think of is instead of telling Finder to open the file, tell whatever you use to view PDF's to open it.

  • Author

Irrespective of paths and applications, there is a problem with this syntax. When executing the listed code, the following dialog appears:

"Expected end of line but found command name".

Clicking OK yields a dialog of:

"Unknown Error: -2741."

Suggestions? Thanks.

I generally don't use calculation field AppleScripts, I usually use the Perform AppleScript step, mostly 'cause it's easier to write and test long scripts. But you could try this for your calculation instead, just 1 line:

"tell application "Finder" to open "Macintosh HD:" & testinglinks::imagefile & """

  • Author

YES! Thanks Fenton. That works as a Perform AppleScript step. It all boiled down to that missing "to" in front of the "open" command.

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.