很酷的东西!
如果您安装了“通知脚本”(http://www.cooperative-fruitiere.com/notifications/index_en.html),那么您甚至可以收到通知,通知您有关该语言的信息。在 FastScripts 的帮助下,您可以为该脚本分配键盘快捷键。
-- Switch the language of Mountain Lion's dictation
-- Here, we just toggle between English and German
-- Needs 'Notifications Scripting' ( http://www.cooperative-fruitiere.com/notifications/index_en.html )
delay 0.3 -- time to release modifier keys if the script is run with a shortcut
tell application "System Preferences"
reveal anchor "Dictation" of pane "com.apple.preference.speech"
end tell
tell application "System Events" to tell process "System Preferences"
tell pop up button 1 of tab group 1 of window 1
click
if value is "English (United States)" then
set language to "German (Germany)"
else
set language to "English (United States)"
end if
click menu item language of menu 1
end tell
end tell
quit application "System Preferences"
tell application "Notifications Scripting"
set event handlers script path to (path to me)
-- The user info parameter is a record. The supported data types are text, integer, real, boolean, date, alias, file and POSIX file.
set dict to {theName:"Notifications Scripting", theVersion:"1.0", theScript:event handlers script path}
display notification "Dictation Language" subtitle "Switched to:" message language
end tell
using terms from application "Notifications Scripting"
-- This handler is called when a notification was delivered.
on notification delivered title aTitle subtitle aSubTitle message aMessage actual delivery date aDeliveryDate user info aDict
end notification delivered
end using terms from