|
|
Toggle Character Palette and Keyboard Viewer on/off
Thanks to etatoby and N. Riley for including a Snow Leopard solution for Keyboard Viewer.
Here's a replacement for the Character Palette toggle script that works for Snow Leopard.
property querylist : {"CharacterPalette"}
property app_is_up : missing value
set app_is_up to false
set frontapp to getFrontApplication()
repeat with i in querylist
set the_ps to paragraphs of (do shell script "/bin/ps -acx")
tid("/")
repeat with _line in the_ps
if _line is "" then
else
if _line contains i then
set app_is_up to true
set _pid to first word of _line
end if
end if
end repeat
tid("")
end repeat
if app_is_up then
tell application "/System/Library/Input Methods/CharacterPalette.app" to quit
else
tell application "/System/Library/Input Methods/CharacterPalette.app" to activate
end if
tell application frontapp to activate
on tid(s)
set my text item delimiters to s
end tid
on getFrontApplication()
(path to frontmost application) as text
end getFrontApplication
Edited on Jan 28, '10 11:59:56AM by llee
Toggle Character Palette and Keyboard Viewer on/off
Well, Rob G. politely enlightened me to the fact that I'm apparently not enough of a desktop publisher to realize that there is a benefit to be derived from making the distinction between dragging those characters in there and clicking the button in Character viewer. I hadn't previously linked the failure of the button to the viewer launching method. I just thought it was a palette scope thing with the app I was using. I actually believe I remember at some point considering whether to submit a bug report that the button in Character viewer doesn't always work. Thanks to Rob for revealing the embarrassing truth.
However, now I'm quite intrigued by the possibility of modifying Nicholas Riley's source for his keyboardViewer executable to make one that provides the same functionality for the Character viewer. github.com/nriley/keyboardViewer Maybe Nicholas can be persuaded to release a remedy himself. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks 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.14 seconds |
|