PagePacker print service
Save the following as AppleScript in "Library/PDF Services". It will show up in the print dialog in the PDF popup:
[CODE]on open these_items try set f to the item 1 of these_items tell application "PagePacker" set page size to A4 make new document tell document 1 set file source of page 1 to f end tell tell application "System Events" tell process "PagePacker" activate set frontmost to true keystroke "p" using command down end tell end tell end tell on error error_message number error_number if the error_number is not -128 then tell application (path to frontmost application as string) display dialog error_message buttons {"OK"} default button 1 end tell end if end try end open[/CODE] Stefan |
Wonderful. Thank you !
For those who have not downloaded the PagePacker print utility, it is at: [URL="http://weblog.bignerdranch.com/?p=23"]http://weblog.bignerdranch.com/?p=23[/URL] [CODE]set page size to A4[/CODE]may not suit all. I think that letter size is probably the Pagepacker default, but in any case the PagePacker Applescript dictionary allows for [CODE]set page size to letter[/CODE] |
To make the whole process perfect I want to open the print dialog for a "print" perspective automatically via AppleScript, and then run the "Print to PagePacker" service. But it seems this is not so easy. There are several threads on the web about scripting the printing dialog, but none has a clean solution.
Stefan |
Error
When I try this all I get is an OF dialog reading "Print - Error while printing." Any idea about what I'm screwing up? I follow the instructions word-for-word and also tried A4 and Letter. I'm using OmniFocus/1.0/final-v77.1.2 on Leopard.
|
I'm getting the same error. Would love to know if anyone has found a fix for this, as it seems like a great add-on.
|
Hallo!
I have changed my process of printing with PagePacker now in the following way: * I have created a PDF printer with the cups-pdf package. This is used to print the "Drucken" perspective from OmniFocus into the folder ~/Desktop/cups-pdf. To create a perspective which always prints to the PDF printer, I think, the only way is to change the default printer to the PDF printer OSX wide, then recreate the "Printing" perspective. After that you can change the printer back to your normal printer. The perspective will remember the PDF printer though. * Then I attached the following script to that folder as an folder action: [CODE]on pagepack(f) tell application "PagePacker" activate set page size to A4 make new document set doc to document 1 tell doc delay 1 set file source of page 1 to f delay 1 end tell set win to window 1 where its document is doc set winname to name of win as Unicode text tell application "System Events" tell process "PagePacker" activate set frontmost to true set evwin to window 1 where its name is winname keystroke "p" using command down repeat until (count of sheets of evwin) is not 0 end repeat repeat while (count of sheets of evwin) is not 0 end repeat end tell end tell close win without saving delay 2 quit end tell end pagepack on adding folder items to this_folder after receiving added_items try set f to (first item of added_items) pagepack(f) tell application "Finder" delete f end tell end try end adding folder items to on run tell application "OmniFocus" print (perspective "Drucken") without print dialog end tell end run [/CODE] This code takes the PDF from the cups-pdf printer, puts it into PagePacker, calls the print dialog of PagePacker and after printing it deletes the pdf file and closes PagePacker. Works fine for me (most of the times, once in a while PagePacker does not get the pdf, no idea why. But only once out of 10 or so). The trouble with the PDF printer is really needed I fear, because OSX has no way to call the "Export to PDF" action in the print dialog via AppleScript. There are plenty of threads on the web with half working solutions. But nothing reliable and easy. Schimmi |
Shimmi,
hi, I have tried to follow your instructions to get this to work, but I feel I am not that technical or there is something I am missing. Here is what I did. I installed cups-pdf I created a perspective for it to print. I created an applescript with your code changing the Drunken for my perspective. I attached that applescript to the cups-pdf folder as a folder action. Now I dont know how or understand how to execute the print. I tried printing the perspective from OF using the cups-pdf and it does not work. Please explain how I should use this. thanks Jack |
Hi jbursztyn,
I had the same problem as you. I found Shimmi's script has to be saved in /Library/Scripts/Folder Script Actions. Once here you can run the script directly. |
[QUOTE=Schimmi;30943]Hallo!
This is used to print the "Drucken" perspective from OmniFocus .... [/QUOTE] Sorry if a bit off topic ... but what is the "Drucken" perspective? I've been unsucessful at getting my OF output to have a readable font size when sent to Page Packer ... (except by toggling the "Change All Font Sizes" from Preferences>Style). Would be great if "Style" info could be saved into the Perspective itself. troy |
Troy, "Drucken" is German for "Print". :-)
Pretty sure we have a feature request open on saving Page Setup info on a per-perspective basis; if you email the [EMAIL="Omnifocus@omnigroup.com"]support ninjas[/EMAIL], they can vote that up on your behalf. |
All times are GMT -8. The time now is 05:15 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.