Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok. So I am having a little trouble getting an apple script program to work. Basically, I have a text file named Proxy.rtf and I need an applescript that grabs line one from this text file and changes the proxy settings on my mac to use that proxy. Then open a webpage using the new proxy settings. Then, basically I just want it to keep doing this until it reaches the end of the text file. Any ideas?

Thanks

share|improve this question
    
Is there a reason you have an RTF document for this? – Daniel Beck Apr 26 '12 at 5:41

I don't know any proxy servers to test with, but this should have the same effect as setting a proxy in System Preferences > Network > Advanced… > Proxies > Web Proxy (HTTP).

#!/bin/bash

networkservice="Wi-Fi" # or something like Built-in Ethernet or HUAWEIMobile-Modem
for p in `cat proxies.txt`; do
    networksetup -setwebproxy "$networkservice" $p 80
    open http://superuser.com
    sleep 10
done
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .