{"identifier":35579,"topic":"Commands","name":"doMenu","text":"<code>doMenu <i>itemName<\/i> <\/code>[<code>without dialog<\/code>] <code>\u00ac        <\/code> [<code>with <i>keys <\/i><\/code>]<code> doMenu <i>itemName<\/i>, <i>menuName<\/i> \u00ac        <\/code>[<code>without dialog<\/code>] [<code>with <i>keys <\/i><\/code>] <br><br>\n\n The<code> doMenu <\/code>command performs the action specified by the item name and menu name just as if the user chose the item directly from the menu. <br><br>\n\n <code>without dialog <\/code> bypasses the dialog box that would normally appear after the commands Delete Stack and Convert Stack, and, when a background field is selected, after Cut Field and Clear Field. <br>\n<br>\n<code>with <i>keys <\/i><\/code>chooses the named menu command with the shift, option, and\/or Command keys pressed.     <br><br>\n\n <br><br>\n\n To determine from a script which  keys were specified, look at<code> param(6) <\/code>of the original command. <br>\n","related":{"34927":null,"69523":"checkMark","70039":"commandChar","3428":"Commands sent automatically","34045":"create","34993":"disable","61996":"enable","71193":"enabled","76221":"markChar","58014":"menus","76567":"menuMessage","45460":"put","45965":"reset","6031":"Where messages are sent initially"},"examples":"doMenu \"Next\"\n\n-- Add another Open Stack command:\nput \"Open Stack...\" after menu \"Go\" with menuMsg \"beep\"\ndoMenu \"Open Stack...\", \"Go\" -- just beeps\ndoMenu \"Open Stack...\", \"File\" -- does an open stack\n\ndoMenu \"Calculator\" -- desk accessory from the Apple menu  \ndoMenu \"Cut Field\" without dialog -- with a bkgnd field selected\n\ndoMenu \"Open Stack...\" with shiftKey -- checks \"New Window\" checkbox\ndoMenu \"Print Card\" with shiftKey -- shows print dialog\n\non doMenu theItem,theMenu\n  if theItem is \"Quit HyperCard\" then answer \"Bye!\" with \"Later\"\n  pass doMenu -- all doMenu messages, including the quit, are passed\nend doMenu","demo":"<code><pre>on mouseUp\n   set cursor to watch\n   <b>doMenu<\/b> \"Background\",\"Edit\" -- view the background layer\n   wait 45\n   <b>doMenu<\/b> \"Background\",\"Edit\" -- return to the card layer\n end mouseUp<\/pre><\/code>\n ","debug":{"9":["doMenu itemName [wit"],"10":["with keys chooses th"]}}