TypeCommand with option not being recognized properly

I have an application that I run through eggplant for testing that hides the menu bar. The problem is that to access it so that I can quit the program I need to type command-option-u. When I try to do this as eggplant suggests, that is, TypeCommand "\oU\O", I instead see the target act as if it had gotten command-o, as it brings up an open dialog.

Is there some other way to send a command-option to a target system? The system in question is running OS X 10.5 if that makes a difference.

Comments

  • Try sending it as a TypeText command.

    TypeText commandDown, optionDown, "u", optionUp, commandUp 
    
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    One further note of clarification regarding this: TypeCommand works very differently from TypeText in a number of ways. TypeCommand treats its parameter as case-insensitive (so TypeCommand "q" is equivalent to TypeCommand "Q"), the special codes like "\o" are not recognized, and instead it uses names for the modifier keys (inside the quotes). To type Command-Option-u you could do this:
    TypeCommand "option u"
    
    Partly because of the inconsistency between these two commands, and because the name TypeCommand is Mac-specific, and also to simplify the use and release of modifier keys (which people sometimes leave down by accident in their scripts), the TypeText command has recently been enhanced. Starting with the next release of Eggplant (version 4.1, due out shortly), you'll be able to say:
    TypeText commandKey, optionKey, "u"
    
    This will become the recommended way to do this, and TypeCommand will eventually become obsolete.
Sign In or Register to comment.