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

346
Vistas
How to get an HTML button disabled status (true or false) into AppleScript?

Buttons in webpages have a disabled status. This status can be true or false. if true, that means the button is greyed out on the webpage.

With Javascript, I can retrieve the status with this:

document.getElementById('view-more').disabled

it will either return true or false.

But if I combine this with AppleScript:

set buttonStatus to do Javascript "document.getElementById('view-more').disabled

Nothing gets returned about the status of the button.

The actual HTML code for the button is:

<button id="view-more" class="view_more">View more</button>

And when the button is disabled it becomes:

<button id="view-more" class="view_more" disabled="disabled">View more</button>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Using a simple HTML file with a disabled button, the following example AppleScript code works for me:

Example AppleScript code:

tell application "Safari"
    do JavaScript "document.getElementById('button').disabled;" in document 1
end tell



The contents of the HTML file as shown in Terminal:

% cat button.html
<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <button id="button" disabled>Button</button>
  </body>
</html>
% 

Screen Shot of Script Editor:

enter image description here




With the button enabled.

The contents of the HTML file as shown in Terminal:

% cat button.html
<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <button id="button">Button</button>
  </body>
</html>
% 

Screen Shot of Script Editor:

enter image description here

about 4 years ago · Juan Pablo Isaza Denunciar
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