AS click or not to click ?????

cheze18

Membre enregistré
13 Septembre 2006
2
0
je voudrais savoir comment activer un bouton .....

exemple : je veux faire un applescrit qui installe un programme au démarrage.


tell application "System Preferences"
activate
set current pane to pane "comptes"
end tell

------

jusque là tout va bien ... j'ai bien la fenetre compte au premier plan ... mais voilà, comment cliquer sur le bouton ouverture (pour activer ce bouton)

click button "ouverture" -- ne marche pas



j'ai essayé avec de nbreux scripts "pompés sur le net" et qui avaient l'air de fonctionner avec "click" mais qui ne fonctionne pas sur ma machine... imac g5 10.4.7 -(Éditeur de scripts Version 2.1.1 (81) -AppleScript 1.10.7)

je ne comprends pas

si quequ'un pouvait m'aider

merci
 
snif ! snif

un exemple de script trouvé sur mac génération :

set lHeuredepart to "0930"
set lHeureArret to "2145"

tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.energysaver"
end tell

tell application "System Events" to tell process "System Preferences" to tell window 1
click button "programmer..."
tell sheet 1
--horaire démarrer ou réactiver
if value of checkbox 1 is 0 then click checkbox 1
tell pop up button 2
click
click menu item "tous les jours" of menu 1 --ou "en semaine", "le week-end" , "lundi" etc...
end tell
repeat until focused of pop up button 2
keystroke tab
end repeat
keystroke tab
keystroke text 1 thru 2 of lHeuredepart
keystroke tab
keystroke text 3 thru 4 of lHeuredepart

---------horaire Éteindre ou suspendre----------------
if value of checkbox 2 is 0 then click checkbox 2
repeat until focused of pop up button 3
keystroke tab
end repeat
keystroke tab
keystroke text 1 thru 2 of lHeureArret
keystroke tab
keystroke text 3 thru 4 of lHeureArret
tell pop up button 3
click
click menu item "tous les jours" of menu 1 --ou "en semaine", "le week-end" , "lundi" etc...
end tell
tell pop up button 1
click
click
get UI elements of menu 1
click (item 2 of the result) -- item 1 est "suspendre" ,item 2 est "Éteindre"
delay 1
end tell
------Fin horaire Éteindre ou suspendre----------------

click button "OK" --validation
end tell
-- quit application "System Preferences"
end tell

====

à partir du 1er click --> message d'erreur :Erreur dans System Events : NSReceiverEvaluationScriptError: 4


autre ex :

tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click menu item "Partage" of menu "Présentation" of menu bar 1
delay 10
tell window "Partage"
if (exists tab group 1) then
tell tab group 1
click radio button "Internet"
delay 1
click button "Démarrer"
delay 1
end tell
end if
end tell
end tell
end tell
ignoring application responses
tell application "System Preferences" to quit
end ignoring
quit


idem au 1er click

est ce que tiger supporte "le click" ou est ce ma version applescript ????


HELP HELP HELP


comment activer ces p..t..ns de boutons