G'day
Your error actually lies in the second click line.
Try…
tell application "Pages"
activate
set file_name to name of document 1
tell application "System Events"
tell application process "Pages"
--keystroke "p" using {command down} --this works
--delay 3
click menu item "Print…" of menu 1 of menu bar item "File" of menu bar 1
click menu button "PDF" of sheet 1 of window file_name
click menu item "Save as PDF…" of menu 1 of menu button "PDF" of sheet 1 of window file_name
end tell
end tell
end tell
I don't have as 'Save PDF to Evernote, so I've substituted 'save as PDF…'
Regards
Santa
tell application "Pages"
activate
set file_name to name of document 1
tell application "System Events"
tell application process "Pages"
--keystroke "p" using {command down} --this works
--delay 3
click menu item "Print…" of menu 1 of menu bar item "File" of menu bar 1
click menu of menu button "PDF" of sheet 1 of window file_name
click menu item "Save PDF to Evernote" of menu 1 of menu button "PDF" of sheet 1 of window file_name --Errors at this line.
end tell
end tell