I have absolutely no knowledge or experience in using Applescript or Automator. I'm hoping by using either to create an app (or script) that will print a test page off my printer automatically. I know how to open the printer app (Canon iX6800 series.app), but I'm stuck from there with the dialog box not knowing how to continue to do the following steps:

  1. Run "Canon iX6800 series" - I got this part…
  2. Select "Settings" or Command S
  3. Select "Utility"
  4. Select "Print Test Page"
  5. Click "OK"
  6. Quit the app.

Any suggestions or help will be greatly appreciated. I can send the actual app to whoever might need it. Thanks in advance. George


I believe I've roughly translated your steps into a working AppleScript:

tell application "Canon iX6800 series" to activate -- Run "Canon iX6800 series"
delay 0.25
tell application "System Events" to tell process "Canon iX6800 series"
    click menu item "Canon iX6800 series" of menu "Window" of menu bar 1
    click menu item "Settings" of menu "Printer" of menu bar 1 -- Select "Settings"
    click radio button "Utility" of tab group 1 of sheet 1 of window 1 -- Select "Utility"
    click button "Print Test Page" of tab group 1 of sheet 1 of window 1 -- Select "Print Test Page"
    key code 53 -- escape key (selects Cancel)
end tell
tell application "Canon iX6800 series" to quit -- Quit the app

Note that the part at the beginning (with the delay and window selection) is necessary to ensure that an active window is open in the printer app; otherwise, the Settings panel won't be able to open if a window isn't already open.

Although the following isn't what the OP is asking for, in case anybody else is looking to do this with a printer that doesn't supply a "Print Test Page" option in the Settings panel, here's an alternate solution:

  1. Open the "Canon iX6800 series" app
  2. Click the "Print Test Page" menu item in the "Printer" menu
  3. Quit the app

To accomplish this, replace lines 5–7 of the above with click menu item "Print Test Page" of menu "Printer" of menu bar 1.

| improve this answer | |
  • Thank so much for your help in creating the script that produce mostly what I'm looking for. The only problem is it's giving me a different Test Page than the one I need. There are two possible Test Page that can be printed and the one I need will need to add a couple more steps in order to get there. I will try to explain what I've done so far, and what else is needed to get to the other Test Page in the next message… – George Mok Jul 2 at 7:04
  • So far I've kept the first and the last line, and made changes to part of the second line from: tell application "System Events" to tell process "Canon iX6800 series" to click menu item "Print Test Page" of menu "Printer" of menu bar 1 to tell application "System Events" to tell process "Canon iX6800 series" to click menu item "Settings" of menu "Printer" of menu bar 1 Now it opens up "General", "Supply Levels", "Utility", and I need to click on Utility Then it opens up "Open Printer Utility" and "Print Test Page". That's the "Print Test Page" I need to select. – George Mok Jul 2 at 7:06
  • @GeorgeMok Thanks for clarifying—you might see if the new version of the script works (I've edited my answer). – aaplmath Jul 2 at 14:53
  • Thank you for your response. I tried the new version and it worked but it's giving me the other Test Page (the wrong one). So I tried the longer version without replacement of line 5-7 and it gave me the correct Test Page I was looking for. But the app did not quit and gave me an error "error "Canon iX6800 series got an error: User canceled." number -128". I also realized that the "Cancel" button has to be clicked before the app would quit. I'm not sure how to avoid the error at the same time apply the Cancel before quitting. – George Mok Jul 2 at 20:16
  • @GeorgeMok Is it possible you could share some screenshots of the flow that's supposed to occur in the printer app? I can't seem to emulate these screens on my own Mac. – aaplmath Jul 4 at 22:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .