03-22-2024, 03:20 AM (This post was last modified: 03-22-2024, 03:59 AM by Davider.)
I need to get the name of the currently open tab in the Linqpad window (indicated by the pink arrow in the image),
The text obtained after executing the LA code (indicated by the red arrow below),
The text obtained after executing the QM code (indicated by the green arrow below).
Which tag should be added to solve this problem?
03-22-2024, 05:34 AM (This post was last modified: 03-22-2024, 05:43 AM by Davider.)
@birdywen
I have been using QM for quite some time now and am currently trying to replace the tasks previously done with QM with LA. In many aspects, it feels very good.
Most of the issues are related to the interaction between programming languages (PowerShell, Python, QM, LA).
@Gintaras Thanks for your help.
Was the code for #3 Auto generated using the functionality in the Ctrl+Shift+E dialog?
Yes. I captured the PAGETAB, then added it to path, then selected its parent PAGETABLIST, set skip 1, added to path. Finally removed unnecessary properties.
03-22-2024, 08:37 AM (This post was last modified: 03-22-2024, 09:17 AM by Davider.)
Quote:Yes. I captured the PAGETAB, then added it to path, then selected its parent PAGETABLIST, set skip 1, added to path. Finally removed unnecessary properties.
After several attempts, I found an issue:
the generated code lacks the (prop:) tag. I have to add it manually; otherwise, the element cannot be correctly located.
Please see the demonstration in the below. https://i.ibb.co/6sbcp51/A.gif
If possible, it is recommended to consistently add the "prop:" tag.
I frequently conduct extensive tests to confirm that the 'state' attribute in the QM code below does not take effect and can only iterate through each sub-object.
This works in LA and the code is simple and easy to understand
#10. I usually just uncheck name in the Find UI element tool. But if want to delete the name argument later in code, it's easy to replace it with `null` or add `prop:`.
#11. To easily create correct state code, click the state text field in the "Find" tool. A small button will appear at its right side...
Quote:#10. I usually just uncheck name in the Find UI element tool. But if want to delete the name argument later in code, it's easy to replace it with `null` or add `prop:`.
Very useful.
Quote:#11. To easily create correct state code, click the state text field in the "Find" tool. A small button will appear at its right side...
out int w=win("LINQPad""*.Window.*") Acc a.Find(w "PAGETABLIST""""class=HwndWrapper[DefaultDomain;;*]"0x100432) ARRAY(Acc) c; a.GetChildObjects(c -1"PAGETAB""""class=HwndWrapper[DefaultDomain;;*][]state=0x300002 0x0")
c[0].State(_s);out _s out c[0].Name
If the tool generates code where the second state number is 0 (eg `state=0x300002 0x0`), it means you did not check anything in the Use column in the State dialog.
You're right. The problem has been solved! Thank you very much!
ARRAY(Acc) c; a.GetChildObjects(c -1 "PAGETAB" "" "class=HwndWrapper[DefaultDomain;;*][]state=0x2 0x2")