Using the GetHandle Command in NSL



By: dguest

April 1, 2008 8:19 am

Reads: 146

Comments:0

Rating:0

Problem

A Forum reader recently asked:

“I found the new command “GetHandle” to be potentially very useful, as often you might want to interact with the parent window after the child window has closed. My question is, how do I use it?

For example, can I use the handle with SetFocus? Or Type? In other words, can I use it to interact with the controls of the parent (initial) window after I’ve closed the child window without messing around with Type /raw stuff?”

And here is the response from David Guest …

Solution

I’ve done some digging and it appears that you cannot use this with SetFocus. However, it could be used to verify that you have returned back to the initial dialog screen and so need to type in the UserID/Password/Optional fields again. This will need to be done with the /raw, but it does mean that you can verify that you are at the right screen/window so the ID/Password will not magically appear somewhere else.

So, you could try this:

Dialog
Title "Log In"
EndDialog

GetHandle ?OriginalScreen
Type $Username #1001
Type $Password #1002
Click #2

Dialog
Title "Log In Failure"
EndDialog

DisplayVariables "Your ID and Password appear to be wrong." $Username 
$Password
Click #2

GetHandle ?CurrentScreen
If ?OriginalScreen eq ?CurrentScreen
     Type $Username -raw
     Type \T -raw
     Type $Password -raw
     Type \N -raw
Else
     MessageBox "Please log in again with the correct ID"
EndIf

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: ,
Categories: Uncategorized

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

Comment