| OS X - Operating System General OS operation information and support |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Mar 26, 2009
Posts: 2
![]() |
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 |
| QUOTE Thanks | |
![]() Member Since: Mar 09, 2004
Location: Munich
Posts: 9,075
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
|
If it doesn't you could also try running the command-line based version of transmission and then using a shell script command to throttle it. |
||||
| QUOTE Thanks | |||||
![]() Member Since: Dec 26, 2010
Posts: 1
![]() |
Thank you very much, your script has help me a lot
![]() And I'm gonna help you!! What you need if a menu is "checked" is the attribute AXMenuItemMarkChar, something like: set isChecked to ((value of attribute "AXMenuItemMarkChar" of -themenuitem-) ≠ "") that because AXMenuItemMarkChar is the tick char, if there isn't the check it is just nothing
|
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| OnMyCommand - build your own Contextual Menu Item | MacHeadCase | OS X - Apps and Games | 0 | 05-07-2007 12:19 PM |
| Menu Item to Open Close DVD tray | CaptVijay | OS X - Apps and Games | 2 | 04-12-2007 12:30 AM |
| sometimes the left mouse button brings up contextual menu? | silverr | OS X - Operating System | 4 | 10-07-2006 02:07 AM |
| Invisible Menu Bar Item | roma0104 | OS X - Operating System | 2 | 06-02-2006 11:12 PM |
| modify contextual list menu | mik4 | Schweb's Lounge | 0 | 12-30-2003 11:13 PM |
All times are GMT -4. The time now is 10:31 AM.
Powered by vBulletin