The Parent command begins a parent block in which the statements act upon a window's parent. The commands that follow the Parent command function identically to commands used in a dialog block. If they equate to False, the script ends. For example, the command Title in a Parent block returns False if the title of the Parent doesn't match the one specified in the command. However, if a command in a Parent block returns a False result, the execution doesn't skip to the next Parent block, as it would in a dialog block. Instead, the Parent block proceeds to the next dialog box, or the script terminates if no further dialog block exists. The EndParent command terminates a Parent block and sets the subject of the script back to the original window. You can nest the Parent command, allowing the parent block to act on the parent of the parent. The Parent command is particularly useful in applications where the dialog box (for example, Login Dialog Box) is the child of an open window, typically in the background. If you are unable to single sign-on to an application after enabling it with the Wizard, you typically need to specify Parent blocks. Also, you can use the Parent command to execute commands on a dialog's parent. For example, you can get a script to click a button on the parent window, as illustrated in Example 2. HINT: If you use the wizard or try to enable an application and it doesn't seem to be working, try using the Parent command. It is able to handle windows that are within windows. |