Applescript seems very powerful but hard to find answers to "simple" ?s it seems.
I'm trying to adapt a page numbering script for use with PDF Pen. I have managed to change the print location and text in the script as shown here:
tell application "PDFpen"
if (count documents) > 0 then
-- Get value for what should be prepended to beginning of numbering scheme.
set prepend_value to text returned of (display dialog ¬
"Enter numbering prefix:" with title ¬
"Bates Numbering" default answer ¬
"© Copyright Partner400, 2011 - xxxxxxx - Page: " buttons {"Cancel", "OK"} ¬
default button "OK")
set font of prepend_value to theFont
set size of prepend_value to (24)
set pageCount to count (pages of document 1)
repeat with pageNumber from 1 to pageCount
set thePage to page pageNumber of document 1
set currentPage to prepend_value & pageNumber & " of " & pageCount as rich text
make new text imprint at end of imprints of thePage with properties {rich text:currentPage, x position:60, y position:16, height:16, width:540}
end repeat
return pageCount
end if
end tell
The script works fine but I cannot find how to set the font and size. I have tried adding the lines:
set theFont to {"Arial"}
set font of prepend_value to theFont
set size of prepend_value to (24)
to the script but I just get error messages.
ANy hints as to what is wrong and/or where I can look for help.
I'm trying to adapt a page numbering script for use with PDF Pen. I have managed to change the print location and text in the script as shown here:
tell application "PDFpen"
if (count documents) > 0 then
-- Get value for what should be prepended to beginning of numbering scheme.
set prepend_value to text returned of (display dialog ¬
"Enter numbering prefix:" with title ¬
"Bates Numbering" default answer ¬
"© Copyright Partner400, 2011 - xxxxxxx - Page: " buttons {"Cancel", "OK"} ¬
default button "OK")
set font of prepend_value to theFont
set size of prepend_value to (24)
set pageCount to count (pages of document 1)
repeat with pageNumber from 1 to pageCount
set thePage to page pageNumber of document 1
set currentPage to prepend_value & pageNumber & " of " & pageCount as rich text
make new text imprint at end of imprints of thePage with properties {rich text:currentPage, x position:60, y position:16, height:16, width:540}
end repeat
return pageCount
end if
end tell
The script works fine but I cannot find how to set the font and size. I have tried adding the lines:
set theFont to {"Arial"}
set font of prepend_value to theFont
set size of prepend_value to (24)
to the script but I just get error messages.
ANy hints as to what is wrong and/or where I can look for help.