Le 22/01/2013 à 15:44, Alex Zavatone < email@hidden> a écrit : On Jan 22, 2013, at 9:34 AM, koenig.yvan wrote: I'm a bit puzzled.
button 1 of window "Network"
is the close button of this window so it would be difficult for the script to trigger button "Apply" of sheet 1 of window "Network"
So I guess that you wanted to trigger an other button than the first one.
If this is true, then there are two tools that should help you out a bunch.
UIElementInspector from Apple and UI Browser from Bill Cheeseman/PFiddlesoft
I can send you a copy of UIElementInspector in a zip since it is Apple sample code
Here I use the Accessibility Inspector.app embedded in the free Xcode.app.Macintosh HD:Applications:Applications_MAS:Xcode.app:Contents:Applications:Accessibility Inspector.app:
When the Network pane was open, I ran this script :
tell application "System Events" to tell application process "System Preferences" name of every window --> {"Réseau"} tell window 1 subrole of buttons --> {"AXCloseButton", "AXZoomButton", "AXMinimizeButton", missing value, missing value, missing value, missing value, missing value, missing value, missing value, missing value} name of buttons --> {missing value, missing value, missing value, "Pour empêcher les modifications, cliquez ici.", "Assistant…", "Revenir", "Appliquer", missing value, "Avancé…", "Ajouter un service", "Supprimer un service"} end tell end tell
Réseau is the French name for the Network pane. As you may see, the first button is really the close one.
Yvan KOENIG (VALLAURIS, France) mardi 22 janvier 2013 16:26:14
|