tags:

views:

26

answers:

1

I checked here a while ago, and learned how to open firefox from within Ruby (from this post http://stackoverflow.com/questions/435328/open-firefox-browser-with-ruby-automation-script ), and I just made a script which would open all of my common internet sites when run, but it only does so if firefox is already open. If it is not open, it will open one page, on one tab, and then sequentially open the rest, after I close each one.

I tried sleep(5) in case it just wasn't ready, but that didn't work.

In case that wasn't clear, my script was (not enough rep to post multiple urls, but they were full web addresses in my script):

system("firefox somesite.com/")

system("firefox another.com/")

system("firefox aThirdSite.com/")

and, when I ran it, if Firefox was already open, it loaded all three pages in new tabs, but if Firefox was not open, it loaded only the first. Then, when I closed Firefox, it loaded the second, then when I closed it again, it loaded the third.

Is there a way to open Firefox to each web site in separate tabs, given that Firefox is closed before running the script?

+3  A: 

Ok, I just tried separating the web addresses by a space in a single system call, and that seems to have solved the problem. I don't know if one is supposed to delete this or not, but I'll leave it in case someone is searching for this.

system("firefox siteone.com/ sitetwo.com/ sitethree.com/")

Lidmith