文字数制限とかでひっかかるので2つに分けます。
2つを順番にエディタにコピペしてください。
on open myItems
set itms to ""
repeat with f in myItems
set itms to itms & " " & quoted form of (POSIX path of f)
end repeat
my fst(itms)
end open
on fst(myItems)
set myRuby to "
require 'fileutils'
ext=\".pdf\"
fs=ARGV[0..-1]
pdfitem=[]
for thef in fs
if File::ftype(thef) == \"directory\"
Dir::glob(thef+\"**/*\"+ext).each {|f|
pdfitem<<f
}
else
if File.extname(thef)==ext
pdfitem<<thef
end
end
end
p pdfitem"
set myRuby to quoted form of myRuby
set allItems to ""
set allItems to do shell script "ruby -Ku -e " & myRuby & " " & myItems
if not allItems = "" then
set allItems to run script allItems
repeat with i from 1 to length of allItems
set f to item i of allItems
set f to f as POSIX file
tell application "Adobe Acrobat Pro"
open f
if i = 1 then
my paperset()
delay 5
my doOK()
end if
my PdfPrint()
tell front document to close saving no
end tell
end repeat
end if
end fst
[17943] -e (2015/04/22 Wed 11:43)