The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
PagePacker print service Thread Tools Search this Thread Display Modes
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
Stefan

Last edited by Schimmi; 2007-12-30 at 03:27 AM..
 
Wonderful. Thank you !

For those who have not downloaded the PagePacker print utility, it is at:

http://weblog.bignerdranch.com/?p=23

Code:
set page size to A4
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

Last edited by RobTrew; 2007-12-30 at 03:25 AM..
 
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
 
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
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:
Originally Posted by Schimmi View Post
Hallo!
This is used to print the "Drucken" perspective from OmniFocus ....
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 support ninjas, they can vote that up on your behalf.

Last edited by Brian; 2010-06-26 at 06:15 AM..
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Evading Print on Print Dialog jpelton OmniFocus Extras 3 2010-03-21 12:59 PM
OmniFocus -> PagePacker Script [Python] erik_westra OmniFocus Extras 15 2008-04-10 07:57 PM
New clipping service ksrhee OmniFocus 1 for Mac 5 2007-10-10 07:44 AM


All times are GMT -8. The time now is 03:45 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.