1

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

1
  • Is there a reason you have an RTF document for this?
    – Daniel Beck
    Apr 26, 2012 at 5:41

1 Answer 1

2

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

You must log in to answer this question.

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