Re: [AS] Cliquer sur un bouton par son nom

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Yvan KOENIG via Applescript_fr
Date:  
À: Liste AppleScript francophone
CC: Yvan KOENIG
Sujet: Re: [AS] Cliquer sur un bouton par son nom
Je ne sais vraiment pas où se trouve ce bouton.
Je vous propose donc le code le plus développé censé l'atteindre.

tell application "Safari"
    activate
    tell application "System Events"

        
        tell process "Safari"
            set frontmost to true
            set wName to "SMARTDATA FOR LEAD" -- éditer en fonction des besoins ce pourrait être: set wName to 1
            set btnName to "Recherche avancée" -- éditer en fonction des besoins
            tell window wName
                get class of UI elements --> {… splitter group, …}
                tell splitter group 1
                    get class of UI elements --> {…, tab group, …}
                    tell tab group 1
                        get class of UI elements --> {…, group, …}
                        tell group 1
                            get class of UI elements --> {…, group, …}
                            tell group 1
                                get class of UI elements --> {…, scroll area, …}
                                tell scroll area 1
                                    get class of UI elements --> {…, UI Element, …}
                                    tell UI element 1
                                        get class of UI elements --> {…, group, group, group, group, group, group, …}
                                        tell group 6
                                            get class of UI elements --> {…, group, …}
                                            tell group 1
                                                get class of UI elements --> {…, button, …}
                                                get name of buttons
                                                click button btnName
                                            end tell -- group 1
                                        end tell --  group 6
                                    end tell -- UI element 1
                                end tell -- scroll area 1
                            end tell -- group 1
                        end tell -- group 1
                    end tell -- tab group 1
                end tell -- spitter group 1
            end tell -- window Wname            
        end tell -- process Safari
    end tell -- application System Events
end tell -- application Safari


Pourriez vous communiquer le log complet retourné?
Ça me permettrait d'ajouter des commentaires susceptibles de rendre service.

Yvan KOENIG (VALLAURIS, France) dimanche 17 janvier 2021 16:56:59
_______________________________________________
Applescript_fr mailing list
Applescript_fr@???
http://listes.patpro.net/mailman/listinfo/applescript_fr