tell application theApp
activate
tell application "System Events"
tell process theApp
tell menu bar 1
--set aa to get name of every menu bar item
(*
{"Apple", "Safari", "Fichier", "Édition", ¬
"Présentation", "Historique", "Signets", ¬
"Fenêtre", "Aide"}
*)
set nmbi to (name of menu bar item 3) as text (* 3 = "Fichier" *)
tell menu bar item nmbi --"Apple"
tell menu nmbi --"Apple"
--set bb to name of every menu item
(*
{"Nouvelle fenêtre", "Ouvrir un fichier...", ¬
"Ouvrir une adresse...", "-", ¬
"Fermer", "Fermer toutes les fenêtres", ¬
"Enregistrer sous...", "-", ¬
"Format d'impression...", "Imprimer..."}
*)
if useSubMenu is false then
set nmi to (name of menu item 7) as text
click menu item nmi
else
tell menu item nmi --"Location"
tell menu nmi --"Location"
-- set cc to get name of every menu item
(*
{"Automatic", "Configuration (06/11/2004 18:22)",
missing value, "Préférences de Réseau..."}
*)
set nsmi to (name of menu item 1) as text
click menu item nsmi --"Automatic" --location name
end tell -- menu nsmi
end tell -- menu item nsmi
end if -- useSubMenu
end tell -- menu nmbi
end tell --menu bar item nmbi
end tell -- menu bar 1
end tell -- process theApp
end tell -- application System Events
end tell -- application theApp