Jump to content

Opening multiple tabs in a new Chrome window with a delay


Recommended Posts

Is it possible to have a script that will open, say 20 tabs in a new Chrome window, with a 10 second delay between each?

 

I haven't had any luck with the search function and at the moment I'm just attaching 20 Open URL objects to a keyword, which is messy and doesn't delay between loading each tab so it doesn't load properly.

 

Don't have any experience with scripts so would appreciate a push in the right direction.

 

Thanks!

Link to comment

Thanks for the reply vitor,

 

It's for multiple work websites, where each takes about 5-10 seconds to load. If you try opening up all the tabs at once, only one will load and the others will be blank.

 

I thought a script might be better so when I need to update/change the 20 websites or make another one I could possibly just copy and paste the websites in to the script?

 

 

 

 

Link to comment
2 hours ago, RandmTask said:

I thought a script might be better so when I need to update/change the 20 websites or make another one

 

You have the right idea. But you can still get this done in Alfred without a script.


First, add your trigger. Connect an Argument and Variables Utility; in Argument add one URL per line. Connect to a Split Argument Utility set to Split with: New Line and Output as: Arguments. Finally, connect that to an Open URL Action.


When you want to change the URLs, edit the Argument and Variables Utility.


To save everything for reuse, use prefabs.

Link to comment

Meant to ask further about the delay, it isn’t normal that only one of them would load. Can you share which websites you‘re accessing?

 

5 hours ago, RandmTask said:

getting it to open in a new browser window.

 

Start by avoiding Run NSAppleScript in favour of Run Script (see the text at the top of Run NSAppleScript). Better yet, Automation Tasks have an “Open New Webkit Browser Window” under Extras, you don’t need to write it yourself.


Start with that then connect to a Run Script (default settings) of the form:

 

open 'URL_HERE'
sleep 5
open 'ANOTHER_URL_HERE'
sleep 5
open 'THIRD_URL_HERE'

 

Mind the quotes.

Link to comment

It's a work website. It is loading data for a few seconds after opening, and if you open any more pages on the same website it wont load the subsequent one unless the previous page has been fully loaded.

 

Thanks for your help, it works great now, except that the first tab is a new tab and URL_HERE opens in the second tab, ANOTHER_URL_HERE in the third tab etc, but I can live with that.

 

Thanks again!

Link to comment
8 minutes ago, RandmTask said:

except that the first tab is a new tab and URL_HERE opens in the second tab


Put URL_HERE in the Automation Task itself and start the script with the sleep.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...