Estoy tratando de hacer clic en una extensión de Chrome ( Google Highlight : https://chrome.google.com/webstore/detail/multi-highlight/pfgfgjlejbbpfmcfjhdmikihihddeeji ) luego haga clic en el cuadro de texto y pase mis variables.
aquí está mi código
set NoteforGoogleCHrome to "My text should be there"
tell application "Google Chrome"
activate
end tell
tell application "System Events"
tell process "Google Chrome"
delay 2
click button 8 of toolbar 2 of window "myTab" of application process "Google Chrome" of application "System Events"
delay 0.2
keystroke tab
delay 0.2
keystroke NoteforGoogleCHrome
delay 0.2
keystroke space
end tell
end tell
Intenté esto, pero la mayoría de las veces falla.
Cuando trato de hacer clic en el campo de texto (CLICK 2), siempre tengo un error:
haga clic en procesar "Google Chrome" en {4000, 114} --> valor faltante
Sin embargo, si hago lo mismo para CLICK 1, no tengo ningún error.
Me puedes dar algún consejo ?
Lo siguiente me funciona en macOS High Sierra 10.13.5 y Google Chrome 67.0.3396.99.
Ejemplo de código AppleScript :
set NoteforGoogleCHrome to "click me"
tell application "Google Chrome" to activate
delay 0.5
tell application "System Events"
click (every UI element of toolbar 2 of front window of application process "Chrome" whose help is "Multi-highlight")
delay 1
key code 48 -- # Tab Key
delay 0.2
keystroke NoteforGoogleCHrome & space
end tell
Como puede ver en la imagen a continuación, resaltó todas las apariciones de click
y me
.
Kevin