Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

73
Vistas
Running JS with AppleScript

New to both JS and AppleScript!

The goal of the script is to click a button automatically within a web page using the Safari browser. I have gotten this to work successfully by using other JS methods (for example document.getElementByID(IDName).click();), however, I have to use the title of the button instead, since the ID for the button in this webpage is generated daily (meaning that the ID changes).

I have tested within the browser that document.querySelector('[title="Move to Next Day"]').click(); works to click the button, but getting it to work in my apple script has been an issue.

With my current code below I get an error that says, Expected “,” or “)” but found property. for the last line of code.

Here is my script:

to clickID(theId)
    tell application "Safari"
        do JavaScript "document.querySelector('" & theId & "').click();" in document 1
    end tell
end clickID

clickID('"[title="Move to Next Day"]"')
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda