|
|
Toggle KeyboardViewer (tested on Lion Mac OS X v10.7.2)
This should turn the trick. Save it as an app to ~/Library/Scriptsand assign it a keyboard shortcut using your favorite global shortcuts utility. property KeyboardViewerIsRunning : "" try tell application "System Events" if ((count (every process whose name is "KeyboardViewer")) is 0) then tell application "Finder" open item ":System:Library:Input Methods:KeyboardViewer.app" of the startup disk end tell set KeyboardViewerIsRunning to false else set KeyboardViewerIsRunning to true end if end tell if (KeyboardViewerIsRunning) then tell application "KeyboardViewer" to quit else tell application "KeyboardViewer" to activate end if on error msg number errNum displayError(msg, errNum) quit end try -- Error Messaging on displayError(msg, errNum) set msg to styleMsg(msg) display dialog "\"Cannot toggle KeyboardViewer\" " & msg & " Error number " & errNum & "." end displayError on styleMsg(msg) set firstLetter to character 1 of msg considering case if firstLetter is not in "abcdefghijklmnopqrstuvwxyz" then set firstLetter to makelower(firstLetter) end considering if length of msg > 1 then set msgRemainder to text 2 thru (length of msg) of msg end if set msg to firstLetter & msgRemainder return msg end styleMsg on makelower(theText) set newText to "" repeat with i from 1 to (length of theText) set newText to newText & lower(character i of theText) end repeat return newText end makelower on lower(_letter) considering case set myChar to offset of _letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" if myChar > 0 then return character myChar of "abcdefghijklmnopqrstuvwxyz" else return _letter end if end considering end lower Edited on Feb 09, '12 11:06:10AM by mistersquid
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|