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

100
Visualizações
AppleScript For Multiple Safari Tabs And Mouse Click?

Complete noob to AppleScript here with a rather complex one:

I would like automate a script that can do the following:

  1. After launching, waits for 61 minutes without doing anything, then:

  2. Opens Safari with 16 tabs (and 16 separate URLS)

  3. Clicks a “Roll!” button on each of the 16 tabs, then pauses for 10 seconds, then:

  4. Closes Safari

  5. Waits another 61 minutes, then:

  6. Performs 2 through 5 over again for a total of 15 repetitions.

One thing to note:

Each URL is unique to the other 15, but they are the same for every repetition.

Is this even possible? From my research into AppleScript I understand there will need to be a little Javascript in there too?

All help appreciated!! Cheers

UPDATE: Ok, I've been tinkering and I found a script to open the 16 tabs (set to generic URLS at the mo):

set urlList to {"http://www.macintouch.com/", "http://www.macnn.com/", "http://www.macworld.com/", "http://www.thinksecret.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/", "http://www.tuaw.com/"}
set numURLs to (count urlList)

tell application "Safari"
    activate
    -- create all the tabs that are needed
    tell application "System Events"
        -- enter the url in the open window
        keystroke (item 1 of urlList)
        key code 36
        repeat with i from 2 to (numURLs)
            -- for each additional url, first create a tab
            tell process "Safari"
                click menu item "New Tab" of menu "File" of menu bar 1
            end tell
            -- now enter the url
            keystroke (item i of urlList)
            key code 36
        end repeat
    end tell
end tell

Can someone help me from here in? The first thing I need is the delay function. So, before this script does anything it waits for 61 minutes.

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