OVH Cloud OVH Cloud

[applescript]

2 réponses
Avatar
Nicolas.MICHEL
Bonjour à tous

Selon le site ci dessous, on peut scripter un truc genre :

click button "Find Next" holding command & option

<http://www.prefab.com/player/docs/applescript/verbs/clickbutton.html>

Sauf que chez moi, il me sort une erreur :
Expected end of line, etc. but found identifier.

( C'est pour ajouter une imprimante genre
"smb://;AUTH=Client%20Krb%20v2@server/printer"
dans Printer Setup Utility )

Mille merci d'avance :)
--
S'il n'y a pas de solutions, c'est qu'il n'y a pas de problèmes
iChat/AIM : michelnicolas

2 réponses

Avatar
pere.noel
Nicolas MICHEL wrote:

Selon le site ci dessous, on peut scripter un truc genre :

click button "Find Next" holding command & option


c'est du GUI Scripting voire Apple :
<http://www.apple.com/applescript/uiscripting/>

ATTENTION ce n'est pas encore mur comme techno...

voire aussi :

<http://conferences.oreillynet.com/cs/macosx2003/view/e_sess/4422>

un pdf à télécharger (bas de page : Download presentation file)

Titre :

AppleScripting the Unscriptable: AppleScript GUI scripting

Alors, de mon expérience, déjà il faut avoir sélectionné la bonne
fenêtre, puis qqc du genre :
(non testé) :

click button "Find Next" using using {command down, option down}

pour exemple, un truc qui a marché chez moi, avec Firefox :

tell application "Firefox"
activate
end tell

tell application "System Events"
tell process "Firefox"
tell menu bar 1
tell menu bar item "Marque-pages"
tell menu "Marque-pages"
click menu item "Gérer les
marque-pages…"
end tell
end tell
end tell
tell menu bar 1
tell menu bar item "Fichier"
tell menu "Fichier"
click menu item "Exporter…"
end tell
end tell
end tell
set rn to random number 1000000
set bookmarks to "bookmarks-tmp-" & (rn as string) &
".html"
tell window "Exporter le fichier des marque-pages :"
set value of text field 1 to bookmarks
click button "Enregistrer"
end tell
keystroke "w" using command down
end tell
end tell

--
une bévue

Avatar
Patrick Stadelmann
In article <1ha3b5e.1dowoceali7b4N%,
(Nicolas MICHEL) wrote:

Bonjour à tous

Selon le site ci dessous, on peut scripter un truc genre :

click button "Find Next" holding command & option

<http://www.prefab.com/player/docs/applescript/verbs/clickbutton.html>

Sauf que chez moi, il me sort une erreur :
Expected end of line, etc. but found identifier.


Il râle sur "holding" ? Ce n'est pas un paramètre valable pour "click"
en tout cas pour un AppleScript de base en 10.3.9. C'est peut-être
possible dans Tiger (voir dans le dictionnaire de System Events, sous
"Processes Suite" -> "Commands") ou alors ça n'est disponible que si le
soft de Prefab est installé (c'est le plus probable).

Infos sur le GUI scripting :
http://www.apple.com/applescript/uiscripting/

Patrick
--
Patrick Stadelmann