![]() |
![]() |
|
help: |
AppleScript |
|
|
PageSender includes support for automation via AppleScript as well as several reference examples. Introduction to Scripting PageSenderPageSender is a printer driver. Scripting is done by establishing preset values (for example, a fax recipient's phone number) to be used by the PageSender printer driver for a particular application then forcing that application to print. Some applications, such as TextEdit and OmniGraffle (and probably most other Cocoa applications), support printing without user interaction using the AppleScript "print" command. Three of the example scripts included with PageSender demonstrate this technique using TextEdit. Other applications, such as FileMaker Pro and Microsoft Word, have their own internal scripting language which supports printing without user interaction. There's a FileMaker Pro example included with PageSender. For Microsoft Word, one strategy is to record a macro in the global template named say "PrintDocument" where all you do is print the current document then stop the recording. Now in AppleScript, you can get Microsoft Word to print without using interaction by using: do script "PrintDocument()". We welcome your scripting techniques feedback. Example ScriptsThree example scripts and one FileMaker Pro database are included with PageSender. They are found in: Email from Script Example - Demonstrates using PageSender to automate Emailing PDFs of whatever you can print. Note that you can set the subject and content using the email info class, and you can even set the recipient type of the email recipient if you'd like to add CC or BCC recipients. Fax from Script Example - Demonstrates using PageSender to automate faxing whatever you can print. Note that you can set multiple cover pages, and you can add additional replacements to your custom cover pages. Prefill Envelope Example - Demonstrates using PageSender to pre-fill the print dialog. Perhaps you wish to pre-fill the print dialog as a convenience yet allow the user to change things before sending. This shows you how. FileMaker Pro Example - We're just casual FileMaker Pro users here at Smile Software, but we thought it would be useful to put together a basic scripting demo. The purpose of the example is to give an idea of how one might use PageSender to automate the Emailing or faxing of invoices from a database. There are two layouts - Data Entry and Invoice, and there are two scripts - Fax Invoices and Email Invoices. The basic idea of the script is to find each data entry record individually, write a customized AppleScript to the global Script field, execute the script, print the invoice (thereby Emailing or faxing it via PageSender), wait a moment for the print job to flow through the queue and repeat. In the FileMaker Pro 8 version of the example, we have FileMaker Pro generate a PDF and pass it directly to PageSender to avoid the delay inherent in going through the print queue. Scripting experts - please feel free to send feedback. Scripting CaveatsHere are some things to watch out for when scripting PageSender:
Customizing Email and Address Book AccessPageSender's own AppleScripts are stored in /Library/Application Support/PageSender/Scripts. There are two types of scripts: those for Address Books and those for Email Clients. You can add support for additional Email clients by writing additional scripts using the existing scripts as a template. If you would like to contribute additional scripts to the product do send them to us. How do I learn AppleScript?Alas, that is beyond the scope of PageSender's online help. You can find a great many resources by starting at Apple's AppleScript Home Page. Happy scripting! |
||
|
|
© 2007-2009 SmileOnMyMac, LLC. All rights reserved. |