Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

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.