This is my first post and I’m new to Scripting. Lots-o-fun.
I have come up with a small script to convert multipage pdf documents in to single page and then build a list of the file names to be later used for variable data printing, and signature layout.
The script below is a portion of the whole gig. The problem I’m having is checking one checkbox in the menu window “extract pages”.
As you will see by the comments in the script, I have tried various ways to either click or test for the state of the clickbox. None of them are working. I always get “System Events got an error: NSReceiverEvaluationScriptError: 4”
I have checked the box with UI Element Inspector and am able to togle it on and off with the AXPress Action. The Inpector window also tells me that the AXEnabled state is 1 ( I assume that this tells me that the checkbox should be accesable through System Events.
Any help or ideas would be greatly appreciated
Thanks again for all the great post. This community has been inspirational.
Here is a portion of the script
tell application “Adobe Acrobat 7.0 Prof#CC75”
activate
choose file with prompt “Select PDF to Covert to Single Page”
copy the result to Orgdoc
open Orgdoc
end tell
tell application “Finder”
activate
set Orgdocname to name of Orgdoc as string
end tell
tell application “Adobe Acrobat 7.0 Prof#CC75”
activate
set PageCount to “”
set Orgdoc to the front document
set PageCount to page count
tell application "System Events"
tell process "Acrobat"
click menu item "Extract Pages..." of menu "Document" of menu bar item "Document" of menu bar 1
tell menu item "Extract Pages..."
keystroke "1"
keystroke tab
keystroke PageCount as string
perform action "AXPress" of checkbox "Extract Pages As Separate Files" of menu item "Extract Pages..." of menu "Document" of menu bar item "Document" of menu bar 1
---select checkbox "Extract Pages As Separate Files" ---of menu item "Extract Pages..." of menu "Document" of menu bar item "Document" of menu bar 1
----click checkbox "Extract Pages As Separate Files" ---of menu item "Extract Pages..." of menu "Document" of menu bar item "Document" of menu bar 1
---get every attribute of menu item "Extract Pages..."
---get every action of menu item "Extract Pages..." of menu "Document" of menu bar item "Document" of menu bar 1
--- get value of checkbox "Extract Pages As Separate Files"
end tell
end tell
---close document 1 saving no
end tell
end tell
Model: Dual 1.8 G5
AppleScript: 1.9.3
Browser: Safari 312.6
Operating System: Mac OS X (10.4)