G’day, & darn it, I originally posted in the wrong forum. (and also didn’t post as a script)
I’ve got this far with a GUI script with Acrobat X, which seems very difficult to script. However, I can’t click on the drop-down menu button that pops up the header & footer panel.
Anybody know how I might get the panel please? We want to update to the CS6 suite, and need automation.
Regards
Santa
set theItem to ((path to desktop) & "This is a test.pdf") as text
set theitem2 to POSIX path of theItem
tell application "Adobe Acrobat Pro"
activate
tell application "Finder"
repeat until exists process "Acrobat"
delay 0.1
end repeat
end tell
delay 1
close all docs saving no
tell application "System Events" to tell process "Acrobat"
click menu item 1 of menu 1 of menu bar item 3 of menu bar 1
set x to 0
repeat while not (exists (window "Open"))
delay 0.1
set x to x + 1
if x ≥ 20 then exit repeat
end repeat
keystroke theitem2
click button "Go" of sheet 1 of window "Open"
click button "Open" of window "Open"
end tell
repeat until exists active doc
delay 0.1
end repeat
tell application "System Events" to tell process "Acrobat"
click menu item "Tools" of menu 1 of menu bar item "View" of menu bar 1
click menu item 1 of menu of menu item "Tools" of menu 1 of menu bar item "View" of menu bar 1
try
# this one works, opens the Pages panel
tell UI element 2 of group 1 of outline 1 of group 2 of group 1 of group 1 of group 1 of group 1 of group 1 of window 1
set {xPosition, yPosition} to position
set {xSize, ySize} to size
end tell
-- modify offsets if hot spot is not centered:
click at {xPosition + (xSize div 2), yPosition + (ySize div 2)}
delay 2
end try
try
# this one doesn't work, trying to click the "Header & Footer" tool button
tell menu button "Header & Footer" of group 1 of group "Pages" of outline "Tools" of group 2 of group 1 of group 1 of group 1 of group 1 of group 1 of window 1
set {xPosition, yPosition} to position
set {xSize, ySize} to size
end tell
-- modify offsets if hot spot is not centered:
click at {xPosition + (xSize div 2), yPosition + (ySize div 2)}
end try
end tell
say active tool as text -- returns 'select'
try
say toolbar visibility as text
set active tool to "Add Header & Footer." --fails
on error errmsg
display dialog errmsg
end try
display dialog theItem as alias as text
--close all docs saving no
end tell