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

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

Recommended Posts

Posted

i have a filepath to a pdf document that imported with this information:

file:// G4/Users/jeffbill/Documents/tutorials/Page 4 - Channels Masking.pdf

into a field called "path"

How do I automate Filemaker with apple events or applescript to launch the file at the end of this path?

I'm new to applescript and apple events

-thanks

-J

Posted

Make a new text calculation field called "path_applescript_calc":

"tell application ""Finder""par.gif

activatepar.gif

if file """ & path & """ exists thenpar.gif

select file """ & path & """par.gif

open selectionpar.gif

elsepar.gif

beeppar.gif

display dialog ""There is no PDF for this file."" with icon 1 buttons (""OK"") default button 1par.gif

end ifpar.gif

end tell"

The triple quote marks pass a single quote mark to the AppleScript. The paragraph markers at the end of each line are to keep the calculation result pretty. It's indented too, but it didn't show up in my post.

Posted

Matt,

Do I type everything from "tell . . . end tell" AS-IS into the "path_applescript_calc" field along with appropriate indents?

I'm dumber than a skunk on this issue, go easy on me smirk.gif

Posted

No. Do NOT use that method. And the post has several errors. Creating fields for applescript is poor practice. Use the perform applescript method and put the script there.

copy cell "Path" of current record to filePath

Tell app "Finder"

try

open file filePath

on error

display dialog ""There is no PDF for this file."" with icon 1 buttons {"OK"} default button 1

end try

end tell

  • 1 month later...

This topic is 7316 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.