Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!