Parent / EndParent

Item Description

Use with:

Windows

SecureLogin Version:

All

Type:

Dialog specifier

Usage:

Parent
EndParent

Arguments:

None

Description:

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.

Example 1:
Windows Script
The Parent command is used to further specify the dialog box that is used for logging in. In this case, the parent of the login box has a Class of "Centura:MDIFrame".

# Login Dialog Box 
Dialog
Class "Centura:Dialog"
Title "Login"
Ctrl #4098
Ctrl #4100
Parent
Class "Centura:MDIFrame"
EndParent
EndDialog
Type $Username #4098 
Type $Password #4100
Click #4101

Example 2:
Windows Script

The Parent command is used to click a button on the Login window's parent.

# Login Dialog Box 
Dialog
Class #32770
Title "Login"
EndDialog
Type $Username #1001 
Type $Password #1002
Parent
Click #1
EndParent