Re: Scripting Print Orientation
Re: Scripting Print Orientation
- Subject: Re: Scripting Print Orientation
- From: "Gary (Lists)" <email@hidden>
- Date: Wed, 26 Dec 2007 12:39:45 -0500
- Thread-topic: Scripting Print Orientation
"Mr. Dan Pouliot" wrote:
>> Use PreFabUIBrowser instead of UIElementInspector. Demo version works
>> for 1 month.
>
> Thanks, that got me much farther down the path. To complicate things,
> I need to also change the print orientation for Firefox. As it is
> right now, I'm sending a javascript:print() command which opens the
> print dialog. However, Firefox doesn't set print orientation in that
> window, but rather in Page Setup (grrrr). So, as it stands right now,
> I have to script FF to first cancel printing, then set print
> orientation, then continue printing. I have a (seemingly) simple
> script to cancel printing then go to page setup (run this script after
> doing cmd-P in FF):
>
> activate application "Firefox"
> tell application "System Events"
> tell process "Firefox"
> click button "Cancel" of window "Print"
> delay 2
> tell menu bar 1
> click menu item "Page Setup..." of menu 1 of menu bar item "File"
> end tell
> end tell
> end tell
>
>
> what's wierd about this script is the Page Setup line only executes
> successfully if I comment out the "Cancel" line. For some reason the
> script doesn't like to cancel printing then open Page Setup. I tried
> adding the delay, but that doesn't help. Any ideas?
Why open the Print dialog just to Cancel it? That doesn't make sense.
Try reversing the procedure, so that you invoke the Page Setup, then normal
close it (accept the settings you make). Then invoke the print command.
Doing things in that reverse order seems backward.
--
Gary
_______________________________________________
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