HomeAppleScriptAppleScriptRendering Pages
  PDF Nomad 2 > Tasks > AppleScript Index

AppleScript examples

-- EXPLODE DOCUMENT BY OUTLINES
tell application "PDF Nomad 2"
      set the targetPath to ((path to desktop folder) & "Exploded Doc") as string
      export document 1 to the targetPath exploding pages by outlines with first page of next outline appended
end tell

-- ADJUST PREVIEW CANVAS SETTINGS
tell application "PDF Nomad 2"
      tell document 1
            tell the preview canvas
                  set the scale factor to 1
                  set the display box to media
            end tell
      end tell
end tell

-- CREATE A NEW OUTLINE
tell application "PDF Nomad 2"
      tell document 1
            set theOutline to make new outline with properties {action type:go to type, label:"The Oscar Wilde Show", action page:p3}
      end tell
end tell

-- ADD ANNOTATIONS TO A PAGE
tell application "PDF Nomad 2"
      tell document 1
            tell page 1
                  set theLine to make new dynamic line with properties {bounds:{200, 100, 80, 120}, modification date:(current date) - 2 * weeks + 2 * hours - 9 * minutes, should display:yes, should print:(no as boolean), color:{30000, 10000, 60000}, contents:"Hallo Welt!"}                                      set formField to make new form field with properties {bounds:{40, 400, 164, 24}, maximum length:4, string value:"My default", field name:"R2d2"}
            end tell
      end tell
end tell

-- DRAW THE PAGES MIRRORED HORIZONTALLY
tell application "PDF Nomad 2"
      tell document 1
            set mirrored pages to true
      end tell
end tell

-- CHANGE DOCUMENT KEYWORDS
tell application "PDF Nomad 2"
      tell document 1
            set the keywords attribute to {"square", "rectangle", "triangle", "polygon"}
            set kw to the keywords attribute
      end tell
end tell

-- GET THE STYLED TEXT OF A PAGE
tell application "PDF Nomad 2"
      tell document 1
            set t to the styled text body of page 1
      end tell
end tell

-- MARKUP A PAGE
tell application "PDF Nomad 2"
      tell document 1
            tell page 1
                  select occurrences of "this"
                  highlight selection
            end tell
      end tell
end tell

-- DESKEW ALL PAGES
tell application "PDF Nomad 2"
      tell document 1
            repeat with pg in pages
                  deskew pg
            end repeat
      end tell
end tell

-- DESKEW A PAGE
tell application "PDF Nomad 2"
      tell document 1
            tell page 1
                  deskew
            end tell
      end tell
end tell

-- OCR SELECTED PAGES
tell application "PDF Nomad 2"
      tell document 1
            OCR with target make pages searchable range selected pages languages {English} brightness 1.0 contrast 9 background threshold 200 resolution for searchable pages Medium
      end tell
end tell


Copyright © SintraWorks
Last updated on June 30, 2015

HomeAppleScriptAppleScriptRendering Pages