Friday, March 20, 2009

No. of Browsers on Desktop

Identifing the required browser on desktop... using descriptive Programming

Using Index property of Ordinal Identifier, we can identify our desired browser...

By using below code we can get the Browser Details like Name,Title... etc., as per our requirement we can get that property

for eg: we have two browsers to identify our desired browser and perform an action on that

If Browser("micclass:=Browser","index:=1").Exist then
name=Browser("micclass:=Browser","index:=1").GetROProperty("name")
print name
name1=Browser("micclass:=Browser","index:=0").GetROProperty("name")
print name1
'print "hello"
else
print "bye"
end if


Dim dp
Set dp=description.Create
dp("micclass").value="Browser"

Set d=desktop.ChildObjects(dp)
co=d.count
print co

For i=0 to co-1
name2=browser("micclass:=Browser","index:="&i).GetROProperty("name")
print "Browser Name of index : "& i &" is--> "&name2
Next

here we got the details of all browsers by using index, use the required index and perform action on that browser.


Thanks & Regards
Baba Fakruddin.D

No comments:

There was an error in this gadget