On Jul 5, 2013, at 10:10 AM, 2551 <2551phil@
gmail.com> wrote:
Woah! Now that's some slick code (oh man, don't you just hate the gurus being gurus sometimes… ;) ).
Thanks for posting! Just needs the filename added to the save dialogue and looks more or less done!
Something changed in Lion or Mt. Lion. I needed to change one line for proper functioning.
tell application "System Events"
set appname to name of first process whose frontmost is true
end tell
activate application appname
tell application "System Events"
tell process appname
-- insert GUI Scripting statements here
keystroke "p" using command down
set PDFButton to menu button "PDF" of sheet 1 of window 1
click PDFButton
click menu item "Save As PDF…" of menu 1 of PDFButton
delay 1
--Note changed line
keystroke (key code 76)
end tell
end tell