Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?


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).


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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.