1

Heres my code. Works fine as long as its a PDF. but if it opens a JPEG after the command window close a new dialog box pops up and asks if I want to save the document as a PDF. I just want to tell it to click don't save and move on... Can't figure it out..

tell application "Adobe Acrobat Pro"
        activate -- bring up acrobat
        open alias mycurrentfile -- acrobat opens that new file    
        tell application "System Events"
            tell process "Acrobat"
                click menu item "Print..." of menu 1 of menu bar item "File" of menu bar 1
                click button "Print" of window "Print"
                tell application "System Events"
                    tell process "Acrobat"
                        click menu item "Close" of menu 1 of menu bar item "File" of menu bar 1

                    end tell
                end tell
            end tell
        end tell
    end tell
drbronze
  • 33
  • 1
  • 8

1 Answers1

0
tell application "Adobe Acrobat Pro"
    activate -- bring up acrobat
    open alias mycurrentfile -- acrobat opens that new file    
    tell application "System Events"
        tell process "Acrobat"
            click menu item "Print..." of menu 1 of menu bar item "File" of menu bar 1
            click button "Print" of window "Print"
        end tell
    end tell
    close document 1 without saving
end tell

if you're just looking to print pdf it might be better to just use preview

set mycurrentfile to choose file
tell application "Preview"
    print mycurrentfile without print dialog
end tell
mcgrailm
  • 17,469
  • 22
  • 83
  • 129