03-26-2012, 05:08 PM
Hi Gintaras, hi all
i tried to "improve" the now well known Firefox4GetTabs function.
To fit my needs, i'd like to sum some tabs properties directly in a variable, and use what i need in time.
But i fail to find the right syntax. Little push needed here.
What i did, but do not work.....
in calling macro
type TABPROP str'name str'url int'index (and some more)
ARRAY(TABPROP) tabs
int selectedTab=Firefox4GetTabs(0 tabs)
--------------------------------------------------
modified Firefox4GetTabs function
function# hwndFF ARRAY(TABPROP)&tabs
** need tabs initialization here
if(!hwndFF) hwndFF=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804); if(!hwndFF) ret -1
enum tabs
Acc a.Find(hwndFF "PAGETAB" "" "class=MozillaWindowClass" 0x1004)
rep
if(a.Role!ROLE_SYSTEM_PAGETAB) goto next ;;[ + ] button
tabs[].name=a.Name
get selected tab
if(r<0 and a.State&STATE_SYSTEM_SELECTED) tabs[].index=i
.......
a.Navigate("n"); err break
i+1
enum panes
a.Find(hwndFF "DOCUMENT" "" "" 0x3011 2 0 "pa3fi")
rep
get id of this pane, and find in ap
fn.FromAcc(a); _s=fn.Attribute("id")
for(i 0 ap.len) if(ap[i]=_s) break
if(i=urls.len) goto next2 ;;should never happen
get url and store in urls[i]
Acc aa; a.Navigate("fi2" aa)
tabs[].url=a.value
.....
a.Navigate("n"); err break
etc etc
I think you get the picture...
Thanks
i tried to "improve" the now well known Firefox4GetTabs function.
To fit my needs, i'd like to sum some tabs properties directly in a variable, and use what i need in time.
But i fail to find the right syntax. Little push needed here.
What i did, but do not work.....
in calling macro
type TABPROP str'name str'url int'index (and some more)
ARRAY(TABPROP) tabs
int selectedTab=Firefox4GetTabs(0 tabs)
--------------------------------------------------
modified Firefox4GetTabs function
function# hwndFF ARRAY(TABPROP)&tabs
** need tabs initialization here
if(!hwndFF) hwndFF=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804); if(!hwndFF) ret -1
enum tabs
Acc a.Find(hwndFF "PAGETAB" "" "class=MozillaWindowClass" 0x1004)
rep
if(a.Role!ROLE_SYSTEM_PAGETAB) goto next ;;[ + ] button
tabs[].name=a.Name
get selected tab
if(r<0 and a.State&STATE_SYSTEM_SELECTED) tabs[].index=i
.......
a.Navigate("n"); err break
i+1
enum panes
a.Find(hwndFF "DOCUMENT" "" "" 0x3011 2 0 "pa3fi")
rep
get id of this pane, and find in ap
fn.FromAcc(a); _s=fn.Attribute("id")
for(i 0 ap.len) if(ap[i]=_s) break
if(i=urls.len) goto next2 ;;should never happen
get url and store in urls[i]
Acc aa; a.Navigate("fi2" aa)
tabs[].url=a.value
.....
a.Navigate("n"); err break
etc etc
I think you get the picture...
Thanks