Link to home
Start Free TrialLog in
Avatar of ppeiris
ppeiris

asked on

AppleScript Save Page As with Safari

Goal:  Save pdf to local directory with scripting on OS 10.5.

Scenario:
When I visit:
http://www.domainname.com/directory/generatereportpdf.aspx?VIUEoYx7fvmJJgtoX2bOw2+bHMUSd9JTe39xjuWnj+lCqxiwPX6JWbEYIq%2fIKvi1etUQkfRAaMBKmokWcUfYRWYxL93jpHV%2fd+YgP+%2f20Br6RFQmqJ5Bb1

It generates a PDF report for me on which I can right click in Safari and save it to my Desktop.  I used to have a process in FileMaker Pro using SuperContainer where I would pass the URL to supercontainer and it would upload it to your servers for document storage.  The provider of the pdf changed their site and now encrypt it as seen above and this process no longer works. The solution to my problem as I see it to have applescript save page as in Safari and save the PDF to a local directory and then have supercontainer retrieve the file from that location.

Current sticking point:
I have not found an applescript example of how to do this.
Thank you for your help
Avatar of Eoin OSullivan
Eoin OSullivan
Flag of Ireland image

Why don't you use the Print to PDF option inside the print dialog in OSX?

You have some access to scripting this with Automator

See this article on how to create a PDF printer .. which you can send the current web page to.
http://www.macgeekery.com/gspot/2005-12/how_to_mass-print_to_pdf

This article contains an applescript that automates the process
http://www.ehmac.ca/mac-ipod-help-troubleshooting/48924-applescript-code-request-print-pdf-function-2.html


depends what you want to save, but if a screen capture is enough, using the web viewer, you can display this page in a filemaker layout and save it as pdf using the pdf export from fm. You would be left with the former solution (supercontainer) to upload it.
ASKER CERTIFIED SOLUTION
Avatar of ppeiris
ppeiris

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial