Estoy tratando de hacer clic en un botón en una página web con AppleScript, pero sólo parece funcionar 1/10 veces. He copiado este código,
to clickID(theId) --creates a function that we can use over and over again instead of writing this code over and over again
tell application "Safari" -- lets AppleScript know what program to controll
do JavaScript "document.getElementById('" & theId & "').click();" in document 1
do JavaScript "document.getElementById('" & theId & "').onclick();" in document 1
do JavaScript "document.getElementById('" & theId & "').submit();" in document 1 -- performs JavaScript code that clicks on the element of a specific id
end tell -- tells Applescript you are done talking to Safari
end clickID -- lets AppleScript know we are done with the function
Añadí las líneas .onClick() y .submit() porque las vi en algunos otros fragmentos de código y pensé que podría ayudar como respaldo. Pero no afectó en absoluto. ¿Es un botón raro o estoy haciendo algo mal?
Gracias.
0 votos
¿Cuál es la URL real, y qué botón si hay más de uno?