Applescript to print Odd Pages only
Applescript to print Odd Pages only
- Subject: Applescript to print Odd Pages only
- From: Bill Guion <email@hidden>
- Date: Sat, 29 Jun 2013 21:42:20 -0400
I'd like a hint (or some hints) for AppleScripting this work flow.
Occasionally I print front and back of pages, but my printer only prints on one side. So, I print all the odd pages, take the output and turn the set over, and put in the manual paper feed. Then I print all the even pages.
This works, but does involve a number of mouse clicks, so I thought I'd write an AppleScript to minimize the clicking. What I envision is running a script to print the odd pages, then manually putting the output in the manual feed tray, and finally running a script to print the even pages. Two clicks, if I've counted properly.
Okay, so the process, for example with Excel, is:
File menu, Print
The next window has three popup menus: the first is Printer, the second is Presets, and the third is Copies & Pages. Click on Copies & Pages and a popup is revealed with seven options, one of which is Paper Handling. Click on Paper Handling and the window changes, with Pages to Print as one option. Click on Pages to Print, and you get three options: all pages, odd pages, and even pages. Here I select either odd or even, depending on where I am in the work flow.
So far, I have
tell application "System Events"
tell process "Excel"
click the menu item "Print..." of the menu "file" of menu bar 1
delay 1
end tell
click menu item "Paper Handling" of the menu "Copies & Pages" of menu bar 3
end tell
The script through line three brings up the print dialog window. But I have not been successful at selecting the Copies & Pages popup. I've tried a number of variations of line 6. The line 6 above generates this error: error "System Events got an error: Can’t get menu bar 3." number -1728 from menu bar 3
If I leave off the of menu bar 3, the error becomes: error "System Events got an error: Can’t get menu \"Copies & Pages\"." number -1728 from menu "Copies & Pages".
I'm reasonably sure (assuming that it can be done) that my problem is with terminology, but If anyone could give me some hints about how to proceed, I would appreciate it.
Aside - I have created preset settings for odd and even, but with AppleScript I'm still faced with selecting from the preset popup menu from the print dialog window.
-----===== Bill =====-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden