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?


  • 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
    open http://superuser.com
    sleep 10
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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