Here’s a script for v2 to convert all selected documents to paginated PDFs:
-- Convert documents to paginated PDFs
-- Created by Christian Grunenberg on Mon Dec 01 2008.
-- Copyright (c) 2008. All rights reserved.
tell application id "com.devon-technologies.thinkpro2"
try
set theSelection to the selection
if theSelection is not {} then
set frontMostWindow to think window 1
repeat with theRecord in theSelection
set theName to (name of theRecord) as string
set theurl to (URL of theRecord) as string
set theWindow to open window for record theRecord
repeat while loading of theWindow
delay 1
end repeat
set theData to paginated PDF of theWindow
set thePDF to create record with {name:theName, URL:theurl, type:PDF document}
set data of thePDF to theData
if theWindow is not the frontMostWindow then close theWindow
end repeat
end if
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell
Tip: Use…
set theData to PDF of theWindow
…instead of…
set theData to paginated PDF of theWindow
…to create single-page PDF documents.