Check VPN / Pause/Resume Transfers applescript

Ask for help and report issues with the Mac OS X version of Transmission
Post Reply
plasticexist3nce
Posts: 5
Joined: Sun Apr 20, 2008 5:50 pm

Check VPN / Pause/Resume Transfers applescript

Post by plasticexist3nce »

wrote this script, but i can't get it to work right. i'm no coder, so any help is much appreciated

Code: Select all

on idle
	tell application "System Events"
		tell current location of network preferences
			set myConnection to the service "VPN (PPTP)"
			if current configuration of myConnection is connected then
				activate application "Transmission"
				delay 15
				tell process "Transmission"
					click menu item "Resume All" of menu 1 of menu bar item "Transfers" of menu bar 1
				end tell
			else if current configuration of myConnection is not connected then
				connect myConnection
				if exists (activate application "Transmission") then
					tell process "Transmission"
						click menu item "Pause All" of menu 1 of menu bar item "Transfers" of menu bar 1
					end tell
				end if
			end if
		end tell
	end tell
	delay 33
end idle
Post Reply