1

I am handicapped and use Dragon Dictate 3. I need to take control of my Mac with Dragon, because I am not be able to use the keyboard. I need to know some Applescript code to do that.

How could I simulate the pressing of the Command key and the Shift key to select multiple items in Finder?

First of all, Thanks to adayzdone for his solution.

I tested these with some success. So let me give it to you for helping other user which are experiencing problems.

1) locking Command key on Dragon dictate 3 procedure.

Name of the command (in french) : " Vérrouillage Touche Commande ". Method : Applescript Context : Finder

set _dictateApp to (name of current application)
    tell application "System Events"
        tell process "Finder"
            command key down
        end tell
    end tell

2) unlocking Command key on Dragon dictate 3 procedure. Name of the command (in french) : " Dévérrouillage Touche Commande ". Method : Applescript Context : Finder

set _dictateApp to (name of current application)
    tell application "System Events"
        tell process "Finder"
            command key up
        end tell
    end tell

3) multiples selections of items in Finder on Dragon dictate 3 procedure. Method : Applescript Context : Finder

set _dictateApp to (name of current application)
tell application _dictateApp
  set bundleID to («property BnID» of «property cCtX»)
end tell
set _currentAppName to short name of (info for (path to application id bundleID as alias))
try
  tell application "System Events"
    tell process _currentAppName
      key code 125 using {shift down}
    end tell
  end tell
end try

AND/OR in another command

set _dictateApp to (name of current application)
tell application _dictateApp
  set bundleID to («property BnID» of «property cCtX»)
end tell
set _currentAppName to short name of (info for (path to application id bundleID as alias))
try
  tell application "System Events"
    tell process _currentAppName
      key code 126 using {shift down}
    end tell
  end tell
end try

Hope it will help. Thanks to all Claude

  • thx for editing my question and to correct my orthography – Claude Bernay Jun 18 '13 at 13:03
  • How would the workflow be triggered? I'm assuming you don't use a mouse? Do you want all of the items of the front window selected ... or items 1 - 3 of 5 ? The more details of the workflow you can include, the easier it will be for people in the forums to help. – adayzdone Jun 18 '13 at 13:09
  • Following up on @adayzdone's comment, there may be better ways to do this than just replicating Cmd and Shift in AppleScript. I don’t have an AppleScript dictionary to hand, but I think Finder has a select command which might be useful, although I can’t remember how it works. – alexwlchan Jun 18 '13 at 13:28
  • I would be able to select all items ones below others AND items 1-3 or 5. Give me all the possibility. No mouse, no keyboard, only voice with custom commands using applescript code, shell, automator workflow. I am looking for a simple program to lock and unlock only modification keys such as command and shift keys, or a program to select multiple items on finder. thanks – Claude Bernay Jun 18 '13 at 13:45
  • I will test this solution on this post... apple.stackexchange.com/questions/69256/… – Claude Bernay Jun 18 '13 at 13:53
1

Briefly looking at the Dragon Dictate manual: enter image description here

A script like this will let you select the next item of a Finder window:

--key code 126 -- up arrow Key
--key code 125 -- down arrow Key

activate application "Finder"
tell application "System Events"
    key code 125 using shift down
end tell
  • thanks a lot dear friend. The solution of the other post also works. I just tested it. – Claude Bernay Jun 18 '13 at 14:14
  • I know how to perform mouse clicks. I know Dragon Dictation allows it by saying "mouseclick" but I would like to just say "click" Does anyone know the AppleScript code for this? – Bobby Aug 5 '14 at 23:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .