Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6900 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

Posted

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 & """

Posted

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

This topic is 6900 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.