Jump to content

Opening a PDF using calculated link


kuma_24
 Share

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

Recommended Posts

Hi, the Troi file plugin will search for a filename and return the directory path.

On the Mac classic or OSX platform I'd use a script to find the file with the Troi plug-in and then send an Applescript/shell script command to open it in the application.

regards, jeff

Link to comment
Share on other sites

  • 3 weeks later...

Thanks to suggestions from this forum before, I was able to create exactly what you're looking for without plugin help. You basically need a predictable file path (either on your local computer or a network). Then, create two calculation fields; one for Macs (using AppleScript) and one for PCs. You can then have your script detect if the user is on Windows or Mac using the Status(CurrentPlatform) function, then use the Perform AppleScript (Mac) or OpenURL (PC) on the resulting calculation field.

Take a look at the screenshot of the fields in my database. The part number of the current record is "025-6000-0014-00". You can see how my folder structure is laid out on the "NetDrive" network volume. I can post the calculations for the fields if you like.

Link to comment
Share on other sites

> Is there a way to browse to a particular file instead of having to type it into the field?

In AppleScript, just say "choose file" That gets you the standard file navigation window. When you pick a file it returns the "alias", which is about the same as "file", but a little more flexible. To convert the result to text, just say "as text" or "as string"

Ex.

tell application "FileMaker Pro"

set cell "Filepath" to (choose file) as text

end tell

"tell" block is not needed within Perform AppleScript (unless you're nested inside another apps tell block), only in Script Editor. FileMaker knows to tell itself. So all you'd need is:

set cell "Filepath" to (choose file) as text

In Troi, you'd use (look at his example files):

External("TrFile-Get FileSpec Dialog", "Choose a file:")

MDLarson, a straight Finder call will work the same in OS X. Not that much has changed.

Link to comment
Share on other sites

Thanks for the tip, Fenton.

I revised my AppleScript calculation to account for common errors on the Mac OS (not having the "Engineering" volume mounted and the absence of the requested PDF). Here's a screenshot of the calculation that actually works with AppleScript (note the multiple quotation marks where needed).

applescript_calc.gif

Link to comment
Share on other sites

This topic is 6541 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
 Share

×
×
  • Create New...

Important Information

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