• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scripting Print Orientation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Print Orientation


  • Subject: Re: Scripting Print Orientation
  • From: "Stockly, Ed" <email@hidden>
  • Date: Wed, 26 Dec 2007 12:48:55 -0800
  • Thread-topic: Scripting Print Orientation

>> Why open the Print dialog just to Cancel it?  That doesn't make sense.

> Yes, it sure does seem backward. However it is a constraint of my current
project whose details I won't bore you with.


You know, there are some people on this list who wouldn't be bored by those
details at all, but approach these kinds of workflow issues as if they were
puzzles.

Anyway, here's a couple things to try.
-------
activate application "Firefox"
tell application "System Events"
    tell process "Firefox"
        click button "Cancel" of window "Print"
        delay 2

    keystroke "." using command down
--or
        click button "Cancel" of UI element 5 of window "Print"

 tell menu bar 1
            click menu item "Page Setup..." of menu 1 of menu bar item
"File"
        end tell
    end tell
end tell

---------

UI Scripting can be very tricky. You're basically piggybacking onto another
technology and the UI elements are not always available in the way one would
expect. I used "UI Browser"  to figure this one out.

Using command period keystroke also works.


HTH,

ES

 _______________________________________________
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

  • Prev by Date: Re: Scripting Print Orientation
  • Next by Date: Re: Modifying incoming mail subject
  • Previous by thread: Re: Scripting Print Orientation
  • Next by thread: changing uppercase/lowercase of MS word footnote text...
  • Index(es):
    • Date
    • Thread