On 15/11/2010, at 1:12 PM, André Renault wrote: Makes sense. Not to be rude, but are there any more changes to be made? I already sent 3 follow-ups to this guy.
Thanks for all your help, much appreciated.
Sent from my iPhone
André, I'm sorry. I hate doing this to you, but I've worked out a way to make the script much faster.
You see, scripts saved as scripts work faster than scripts saved as applications, so I decided to try calling the script as a script from a small app. It is much, much faster.
Save this original script as a plain script on the desktop, calling it just 'Voice.scpt'
property TheVoices : {"Alex", "Fred", "Vicki"}
on run tell application "VoiceOver Utility" activate tell application "System Events" to tell process "VoiceOver Utility" tell window "VoiceOver Utility" select row 3 of table 1 of scroll area 1 select radio button "Voices" of tab group 1 of group 1 click pop up button 1 of tab group 1 of group 1 set TempVoice to get value of pop up button 1 of tab group 1 of group 1 set COV to count of TheVoices repeat with x from 1 to COV if item x of TheVoices = TempVoice then if x = COV then set theVoice to item 1 of TheVoices else set theVoice to item (x + 1) of TheVoices end if exit repeat end if end repeat click menu item theVoice of menu 1 of pop up button 1 of tab group 1 of group 1 click button 1 say theVoice using theVoice end tell end tell end tell end run
Now, save THIS script on the desktop (or anywhere you like) as an App. I called it 'Voice Activator', but it can be called anything. Drag it to the Dock to make a single click activator.
on run run script (((path to desktop) & "Voice.scpt") as text as alias) end run
You should notice a considerable speed difference. My tests indicate changing a voice took 1/3 of the time it took for the script saved as an App. On my intel running 10.6.5, the VoiceOver Utility now just flashes on the screen briefly.
Sorry about my over-active mind doing this to you. Mind you it took longer writing this email than it did writing the script, once it popped into my head.
Regards
Santa
And what, you ask, was the beginning of it all? And it is this...... Existence that multiplied itself For sheer delight of being And plunged with numberless trillions of forms So that it might find itself innumerably
Sri Aurobindo
|