JSON Exporting to file #49
mitchcapper
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The ability to export the visual tree from an arbitrary node is quite useful. Not only does it making diffing interfaces easy, but it provides AI with the ability to visually understand a window far better.
This was up for a few weeks in my other PR by accident but you can find my branch doing so with the code:
https://github.com/mitchcapper/FlaUInspect/tree/with_export
I was able to reuse a good bit of code between the exporter and search tool. In addition I added both UI support and command line support (allowing for AI automation of visual interface reading).
It is key to be able to control what is exported. Different situations care about different things. Sometimes I need to know what actions can be performed on nodes (patterns) other times i care about the actual values of controls.
I did this through the context menu with checkable items making it quick to set and then export. I also added CLI support for doing the same.

You can see some of the more elegant addition of conditional options without a lot of code duplication with the exporter:
https://github.com/mitchcapper/FlaUInspect/blob/with_export/src/FlaUInspect/Core/JsonExporter.cs
I feel the json can be less verbose than the xml from a token count and is an expected format for ai. Personally I also find json easier to read than xml but honestly supporting both isn't that complex.
You can see my CLI at:
https://github.com/mitchcapper/FlaUInspect/blob/with_export/src/FlaUInspect/App.xaml.cs
I allow selecting the window to dump by process or pid, clearly could add HWND. Could add xpath support to just dump a sub-tree from the CLI as well.
Beta Was this translation helpful? Give feedback.
All reactions