Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

72
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda