Same Script Different Website URL

I can think of a few ways to do this but I’m wondering what the simplest would be…

I have 3 identical websites that I run the same script on they are on different servers. Currently, I open the script and the few places where it types in the test url:

TypeText “www.site1.com

I just change it 3 times and re-run the script! has to be a way to automate this…

Run the script on Site1 Then repeat on Site2 Then Repeat on site3

Thanks

Here is my best guess

put ( “http://www.tawala.com” , “http://dev.tawala.com” , “http://build.tawala.com” ) into UrlList

repeat for each item in UrlList
try
put it
run it

end try

end repeat

//Then everywhere in the script where one of the URLs are used

TypeText “UrlList”

// but that can’t possibly work

Heya Bass-o-matic

Simplest way would be to wrap your entire script in a repeat block, and declare a list of the servers you want to hit outside that block:

put ("www.site1.com","www.site2.com", "www.site3.com") into site_list

repeat with each site in site_list
//do stuff..
     typeText site
//do stuff
end repeat

slightly, but not much more complex is to create a master script:

put ("www.site1.com","www.site2.com", "www.site3.com") into site_list

repeat with each site in site_list
    run the_script_to_run site
end repeat

and add the following line to your script

params site

and change your typeText line to

typeText site

I hope this helps!

Works great! Thanks