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

123
Visualizações
AppleScript para hacer clic en la página web con color

Estoy usando AppleScript para abrir una reunión en línea. Aquí, entre 5 pestañas, debo hacer clic en la pestaña de color verde (reunión actual). Cualquier idea de cómo getElementBy color de 'fondo'.

 to clickClassName(theClassName, elementnum) tell application "Safari" do JavaScript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();" in document 1 end tell end clickClassName tell application "Safari" activate open location "https://myclass.lpu.in/" delay 5 tell application "System Events" to tell process "Safari" keystroke "USERNAME" delay 0.2 keystroke tab delay 0.2 keystroke "PASSWORD" delay 1 keystroke return delay 5 end tell end tell clickClassName("btn stretched-link text-white w-100", 0)

Aquí, por fin, necesito agregar una función para abrir esa pestaña verde.

Como en la imagen, hay 5 etiquetas para 5 reuniones ClassName es el mismo, por lo que solo el color de fondo es único en ellas

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Te ayudaré con la solución. No debe acreditar mi solución a otro usuario, de lo contrario nunca lo ayudaré nuevamente. Agregue lo siguiente al final de su script.

 set classNames to {"fc-time-grid-event fc-event fc-start fc-end", "fc-time-grid-event fc-event fc-start fc-end fc-time-grid-event-inset"} set notFounded to true tell application "Safari" repeat with className in classNames if notFounded then -- count all elements of indicated class set theCount to (do JavaScript "document.getElementsByClassName(className).length;" in document 1) as integer if theCount > 0 then -- find element with "background: green" and click it repeat with i from 0 to theCount - 1 set theStyle to (do JavaScript "(document.getElementsByClassName(className)[" & i & "]).getAttribute('style');" in document 1) as text if theStyle contains "background: green;" then do JavaScript "(document.getElementsByClassName(className)[" & i & "]).click();" in document 1 set notFounded to false exit repeat end if end repeat end if end if end repeat end tell
about 4 years ago · Juan Pablo Isaza Relatório
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