Около 70% всего, что я делаю на компьютере, контролируется командами диктовки и моими собственными командами диктовки.Очень мощный материал, когда вы освоите его.Я настроил вас с помощью небольшого сценария с несколькими примерами, чтобы приложение SpeechRecognitionServer непрерывно прослушивало набор голосовых команд для выполнения действий.Я думаю, что это довольно очевидно, глядя на код, чтобы иметь возможность настроить его в соответствии с вашими потребностями.
В редакторе сценариев сохраните следующий код в качестве открытого приложения.Обязательно добавьте ваше новое приложение в Системных настройках в список приложений, которым разрешено управлять вашим компьютером.Теперь все, что вам нужно сделать, это запустить ваше новое приложение.
on idle
try
tell application "SpeechRecognitionServer"
set theChoice to listen continuously for ¬
{"Open Google", "Close Windows", "Enter Name", "Enter Password", "Close My Commands"} ¬
with identifier "mine" with section title "WeeeHaaa's Commands"
if theChoice is "Open Google" then
tell application "Google Chrome" to activate
else if theChoice is "Close Windows" then
tell application "Finder" to close windows
else if theChoice is "Enter Name" then
set myFullname to "Crazy Eddie"
tell application "System Events"
keystroke myFullname
end tell
else if theChoice is "Enter Password" then
set myPassword to "secretpassword"
tell application "System Events"
keystroke myPassword
end tell
else if theChoice is "Close My Commands" then
quit me
end if
end tell
end try
return 0.5
end idle
on quit
-- stop listening
tell application "SpeechRecognitionServer"
stop listening for identifier "mine"
end tell
continue quit
end quit