Re: perform command
Re: perform command
- Subject: Re: perform command
- From: Axel Luttgens <email@hidden>
- Date: Wed, 15 Jun 2011 14:04:37 +0200
Le 14 juin 2011 à 22:29, louie a écrit :
> Hi all,
> I have been struggling with the perform command with voice over the Mac screen reader. From the script dictionary perform command text : The English name of the VoiceOver command to perform. Below is the script. Any help you can give me would be very much appreciated.
>
>
> tell application "VoiceOver"
>
> tell application "System Events"
> tell process "VoiceOver"
> perform the "Open the VoiceOver Help menu"
> end tell
> end tell
> end tell
Hello Louie,
According to its dictionary, application VoiceOver has a "commander" property.
That property allows to refer to the VoiceOver commander, implemented as an object of class "commander object".
Still according to the dictionary, a "commander object" may be targeted with a "perform command" event.
And yes, the "perform command" command expects one argument, "The English name of the VoiceOver command to perform".
So, all of this should be a job for VoiceOver, and VoiceOver only: no need to invoke System Events.
Looking at the various commands made available by VoiceOver, for example thru VoiceOver Utility, it thus seems that your code could be simplified as:
tell application "VoiceOver"
tell commander
perform command "Open VoiceOver Help Menu"
end tell
end tell
But it raises an error: "Error in VoiceOver : Command does not exist"...
Anyway, this is rather encouraging, since VoiceOver really seems to have tried to find a command named "Open VoiceOver Help Menu".
After some guesses, it seems that the list of available commands is provided as a plist at:
/System/Library/PrivateFrameworks/ScreenReader.framework/Versions/A/Resources/SCRStringsToCommandsMap.scrconfig
But all of those commands are lowercase.
And indeed, this one works as expected:
tell application "VoiceOver"
tell commander
perform command "open voiceover help menu"
end tell
end tell
Agreed, that upper/lower case thing is rather stupid... ;-)
HTH,
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden