i still fight with firefox, but the macros get shaping.
1) I wonder if i can access firefox's internal commands by simulating menu actions in directly in a macro,
for instance a right menu item that i can get by doing a right click on a link in a firefox web page ?
open, open in new tab etc...
2)
i have a folder containing all menus, macros, related to firefox stuff.
If i want a shareable variable among all of them, which way is the best? a global one?
How to create it to be that group only accessible (str+ myfirefoxvariable??)
If then isn't it global to all QM macros i have?
3) i want the url of the tab right after the active one.
Any code?
Acc a.Find(w "TEXT" "Se rendre sur un site Web" "class=MozillaWindowClass[]a:placeholder=Se rendre sur un site Web" 0x1005 "previous") is the farest i went to...
1. Can't. Maybe with a firefox addition, eg mozrepl, I didn't test.
2. Global variable. It will be accessible in all macros, not only in that folder.
3. Acc.Find delay
Some types that can allocate much memory have a function like str.all. To free ARRAY, call redim or assign 0.
To easily free a variable of a user defined type (any type) without explicitly freeing each member: assign an empty variable of same type.
It is a path to other object relative to the initially found object.
You can create the string in "Find accessible object" dialog, Navigate field.
Documentation in QM Help, acc topic.
up, down, left, right Spatial navigation. Most objects don't support it.
next, previous Next or previous sibling.
parent Parent.
first, last First or last child.
child Child x. To specify child object, append 1-based child index.
pa3fi => parentx3, ok
fi2 ???
No reference to "fi", sorry if did not understand well.
macro finds a tab, then returns its order in tab row.
can you explain what is retreived exactly by those:
a.Find(hwndFF "DOCUMENT" "" "" 0x3011 2 0 "pa3fi") <================ what is third parent then first child from document accessible object
Acc aa; a.Navigate("fi2" aa) <======== what is two children away from current tab
Don't remember, but the function works somehow
Probably it finds DOCUMENT, and then gets first tab button or tab bar object. Don't remember, maybe it is faster or more reliable than to find the object directly.
Why do you need that info?
Now I tested it with this code, using latest Firefox, and it displays index of selected tab and name/url of all tabs.
Macro Macro1688
No problem with the function Gintaras, i works flawlessly
but i need to understand what is under the hood to adapt it to fit my needs.
I want to be able to find any accessible object from the one i choose, and in your function
i don't understand how you found pa3fi and fi2 values to access url bar text from
acc document object.
Capture an object with "Find accessible object" dialog. Then look in the object tree, and enter path to other object in the Navigate field. Test. If does not work, correct...
code: a.Find(hwndFF "DOCUMENT" "" "" 0x3011 2 0 "pa3fi")
means in plain english : find DOCUMENT object of current tab, then navigate
to third parent, then to first child.
code: Acc aa; a.Navigate("fi2" aa)
out aa.Value
from that pa3fi object , get two level child object
and return it's value (url).
Question: looking at the image enclosed in previous post, where are pa3fi and fi2
located (text in image for object)????????
How did you used pa3fi and fi2????
finds PROPERTYPAGE of the first tab. Note that DOCUMENT is of current tab, it is often not of the first tab. We need first tab to start enumerating tabs. Then we enumerate PROPERTYPAGE for each tab. a.Navigate("fi2" gets DOCUMENT of that tab. We need it to get URL.
int w=win(" - Mozilla Firefox""Mozilla*WindowClass"""0x804) Acc a.Find(w "PAGETAB""Quick Macros Forum""class=MozillaWindowClass"0x100400"first") errret;;probably the last tab
a.DoDefaultAction
finds tab button, gets its first child which is X button
OK then,
applying recent knowledge acquisition, i can create a new tab with that code
int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804); if(!w) ret -1
Acc a.Find(w "MENUITEM" "New tab (after this tab)**" "class=MozillaWindowClass" 0x1005)
a.DoDefaultAction
but i can't close one with that code, similar
int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804); if(!w) ret -1
Acc a.Find(w "MENUITEM" "close tab**" "class=MozillaWindowClass[]a:id=context_closeTab" 0x1005)
a.DoDefaultAction
why?
NB: ** translated from french to english, your mileage may vary
Firefox fills a menu only after using the menu first time.
Many applications change a menu just before opening it, not at startup.
DoDefaultAction works not with all object. Depends on the application. QM just tells the application "please do default action, whatever it is", and the applications does what it wants, maybe nothing.
1. what is the best way to close a specific tab from QM then (either selected or not tab)?
2. i want to do something with selected tab only.
must I tune the macro Firefox4GetTabs with both
enum routines anyway, or can I use it directly on selected tab?
1. I posted the code.
2. All Acc functions work with the selected tab. For example WebPageProp gets URL, name, text, HTML. Find DOCUMENT object and call the function with the variable.