Created
January 13, 2013 21:06
-
-
Save kch/4526218 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
# merge pages from two pdf documents (same as Merge Every Other) | |
# only the two documents to be merged must be opened, the first must be the front window. | |
# this assumes a feed scanner, hence expects the second document's pages to be reversed. | |
require 'appscript' | |
include Appscript | |
pp=app('pdfpen') | |
a, b, c = *pp.documents.get, pp.make(:new => :document) | |
a.pages.get.zip(b.pages.get.reverse).flatten.each { |p| pp.duplicate p, to:c.pages.end } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment