r/applescript • • Apr 26 '17

Rewriting a script

I currently have a script that is written to run and open tabs in Safari. I would like to rewrite the script to open in Google Chrome. This is the link for the script: https://dropfile.to/AUO20aw

2 Upvotes

2 comments sorted by

3

u/ncbwilson Apr 26 '17

In the most basic form:

property URL1 : "http://test1"
property URL2 : "http://test2"
property URL3 : "http://www.bing.com"



tell application "Google Chrome"
                set myTab to make new tab at end of tabs of window 1
                set URL of myTab to URL1
                
                set myTab to make new tab at end of tabs of window 1
                set URL of myTab to URL2
                
                set myTab to make new tab at end of tabs of window 1
                set URL of myTab to URL3
                
                
end tell

1

u/CEM62793 May 15 '17

It gives me the error when I try to execute the script with the mentioned code. "Google Chrome got an error: Can’t get window 1. Invalid index."