January 4, 200620 yr 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.
January 4, 200620 yr 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.
January 4, 200620 yr 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.
January 4, 200620 yr 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 & """
January 4, 200620 yr 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