• 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: Selecting a pop up button value in a Print dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selecting a pop up button value in a Print dialog


  • Subject: Re: Selecting a pop up button value in a Print dialog
  • From: Jim Brandt <email@hidden>
  • Date: Fri, 12 Mar 2010 02:59:16 -0600


On Mar 11, 2010, at 10:40 AM, Axel Luttgens wrote:

Yes: it's always a good idea to provide some info about the context. ;-)


So, 10.4.11.

The print sheet displayed by Safari (and provided by the system) has another layout, so that the pop up button of interest is the second one.

On the other hand, it seems that it is mandatory for the target application to be active.

As a result, this one seems to do the job here, with Safari 4.0.3:


tell application "Safari" to activate

tell application "System Events"

tell application process "Safari"

tell front window

tell front sheet

tell pop up button 2

-- Display the local menu

perform action "AXPress"

tell menu 1

-- Q2: get available "values"

name of menu items

-- Q1: select an option (here, "Save as

")

tell menu item "Enregistrer sous

"

perform action "AXPress"

end tell

end tell

end tell

end tell

end tell

end tell

end tell


Of course, as you did in your sample snippet, I'm assuming the printing sheet is already displayed.


HTH,

Axel



This still doesn't  work for me. Must be a PowerPC, 10.4.11, Safari 4.0.4 problem.

When I pull up UIElementInspector and highlight the button and lock the element, I can perform the action using the perform button in UIElementInspector and the menu displays.

When I use UI Browser 1.4.1 select the pop up button, open the actions drawer and try to perform the action using it, nothing happens.

and

nothing happens when run from the script.

I took this code over to the wife's Mac Book, which has 10.5 on it – the pop up menu works.

I guess that means I'll have to wait until I upgrade  to a new machine to get this feature fixed  :-(

Thanks for all your help!


 _______________________________________________
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

  • Follow-Ups:
    • Re: Selecting a pop up button value in a Print dialog
      • From: "email@hidden" <email@hidden>
    • Re: Selecting a pop up button value in a Print dialog
      • From: Axel Luttgens <email@hidden>
    • Re: Selecting a pop up button value in a Print dialog
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Rép : Osascripting
  • Next by Date: Re: Selecting a pop up button value in a Print dialog
  • Previous by thread: Re: Selecting a pop up button value in a Print dialog
  • Next by thread: Re: Selecting a pop up button value in a Print dialog
  • Index(es):
    • Date
    • Thread