Re: Using AppleScript to Print a Container and Open in a PDF
Re: Using AppleScript to Print a Container and Open in a PDF
- Subject: Re: Using AppleScript to Print a Container and Open in a PDF
- From: wayne melrose <email@hidden>
- Date: Thu, 22 Sep 2011 08:06:24 +0200
On Sep 22, 2011, at 6:20 AM, Jon Rosen wrote:
> Can Applescript be used to script FileMaker's Print script command to open in Preview? Here's the deal: A user saved PDFs in containers (not by reference) and now can't open them. Export Field Contents doesn't work in this case. This seems to be a FileMaker limitation for hosted files.
This sounds strange, if you have a PDF embedded in a contain in FIleMaker, hosted or local, you should be able to write a filemaker script to export the contents of that container... I've just tested, and it works.
>
> I came up with a way for them to view the PDFs the PDFs by printing the container with the option to open in Preview. But, there's a gotcha (sin't there alway?). FileMaker has a Print script command, but it doesn't allow you to select one of the option (i.e., Open PDF in Preview).
Sounds like a bad work around. Task at hand is to open a PDF, stored in a contain, with preview or default PDF reader?
>
> So, I'd like to know if there is an AppleScript way to script this so they could automatically open the container in Preview without having to select that option manually?
Make an button, or just make the container a button, have it launch a script to export the container of the document, you can even hardcode the filepath as it's just a 'temp' pdf file to open if you like then use a 'do shell script open /path/to/temp.pdf' to open the pdf in the default reader.
Mu suggestion is save it to the desktop, and if you like, start the file with a "." ( "~/Desktop/.temp.pdf") so that it's invisible to the user, then, you can always write a 'when closing' script for filemaker that cleans up and removes the temp file with the user shuts down FileMaker.
try --> fail silently
do shell script "rm ~/Desktop/.temp.pdf"
end try
>
> Thanks,
>
> Jo
I've done a sample, I'll send it to you off list, if anyone wants a look, let me know.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden