Jump to content

View a pdf file from a script

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

Recommended Posts

I have a very simple database with records containing only a reference number and a container field with a pdf (reference) in it. I want to use a script to search the file for the reference number, then when it finds it display the pdf file. It looks to me like the Open URL step should open the pdf file, but either I'm reading it wrong or I'm just not getting the syntax for the file path correct (I'm on a mac).

No matter what I do it always tries to open a web site. Now, I know that's what you should expect it to do, but the Filemaker help file gives an example of using it to open Notepad to open a text file.

I could just have them double-click the container field to have the pdf pop up, but it would be a lot nicer if the pdf would just come up by itself.

Seems like this should be a simple thing to do, but I'm not getting it. Thanks for any help.

Link to comment
Share on other sites

You CAN use Open URL[], but you need to (a) extract the absolute reference out of the container field, and (: change the URL protocol from whatever it happens to be into "file://".

The following would work (on a Mac) with contents inserted as file, reference only:

Open URL [ Substitute ( GetValue ( YourTable::ContainerField ; 2 ) ; "filemac:/" ; "file://" ) ]

A simpler way is to have a script simulate a double-click by using the Go to Field{} script step, with "Select/perform" checked.

Link to comment
Share on other sites

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