I've made an applescript stay open application that checks if Transmission is open, and Safari is frontmost, it selects speed limit from Transmission's dock icon.
It's SO **** useful, as my internet is fast and ready when I'm browsing, then if I'm not using it Transmission is free to take up the full bandwidth.
However, I can't seem to find any way to detect whether menu item "Speed Limit" is checked or not. It shows a little tick next to it when it's activated (I've attached a picture), so there MUST be a way to detect that (I hope).
Currently I'm using the property "transmissionLimited" to store whether or not my application has checked it automatically... but sometimes if I want to limit for other purposes it will then UN-LIMIT it when I open up Safari. Nightmare
I've tried using "get ui elements" and "get properties" to no avail. Has anyone got any other ideas?
Also I don't really use forums much. Is there a better forum to ask this question on? Macscripter.net?
Thanks!
Here's what I'm using so far...
on checkTransmission()
try
if (isFrontmost("Safari")) and (isRunning("Transmission")) and (transmissionLimited is false) then
tell application "System Events" to tell process "Dock"
tell UI element "Transmission" of list 1
perform action "AXShowMenu"
click menu item "Speed Limit" of menu 1
end tell
end tell
set transmissionLimited to true
else if (isFrontmost("Safari") is false) and (isRunning("Transmission")) and (transmissionLimited) then
tell application "System Events" to tell process "Dock"
tell UI element "Transmission" of list 1
perform action "AXShowMenu"
click menu item "Speed Limit" of menu 1
end tell
end tell
set transmissionLimited to false
end if
on error
Growl("Auto Speed Limit Failed")
end try
end checkTransmission
It's SO **** useful, as my internet is fast and ready when I'm browsing, then if I'm not using it Transmission is free to take up the full bandwidth.
However, I can't seem to find any way to detect whether menu item "Speed Limit" is checked or not. It shows a little tick next to it when it's activated (I've attached a picture), so there MUST be a way to detect that (I hope).
Currently I'm using the property "transmissionLimited" to store whether or not my application has checked it automatically... but sometimes if I want to limit for other purposes it will then UN-LIMIT it when I open up Safari. Nightmare
I've tried using "get ui elements" and "get properties" to no avail. Has anyone got any other ideas?
Also I don't really use forums much. Is there a better forum to ask this question on? Macscripter.net?
Thanks!
Here's what I'm using so far...
on checkTransmission()
try
if (isFrontmost("Safari")) and (isRunning("Transmission")) and (transmissionLimited is false) then
tell application "System Events" to tell process "Dock"
tell UI element "Transmission" of list 1
perform action "AXShowMenu"
click menu item "Speed Limit" of menu 1
end tell
end tell
set transmissionLimited to true
else if (isFrontmost("Safari") is false) and (isRunning("Transmission")) and (transmissionLimited) then
tell application "System Events" to tell process "Dock"
tell UI element "Transmission" of list 1
perform action "AXShowMenu"
click menu item "Speed Limit" of menu 1
end tell
end tell
set transmissionLimited to false
end if
on error
Growl("Auto Speed Limit Failed")
end try
end checkTransmission