Jump to content

IUIAutomation - Read folders from window and capture it in array - (Moved)


Recommended Posts

Hi,

I am learning AutoIt. I have a requirement to capture the folders of a dialog box into an array. I have highlighted that in the screenshot below. 

I am not able to capture it through Window Info tool. So I am trying to do it with Simple spy tool. 

Below is the script obtained in the Simple spy tool. Can anyone guide me through the next steps to capture the folders in an array? 

Is any sample script available?

 

#include "UIAWrappers.au3"

AutoItSetOption("MustDeclareVars", 1)


Local $oP5=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Microsoft Excel (Product Activation Failed) - Book1;controltype:=UIA_WindowControlTypeId;class:=XLMAIN", $treescope_children)
_UIA_Action($oP5,"setfocus")
Local $oP4=_UIA_getObjectByFindAll($oP5, "Title:=Save As;controltype:=UIA_WindowControlTypeId;class:=#32770", $treescope_children)
_UIA_Action($oP4,"setfocus")
Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=;controltype:=UIA_PaneControlTypeId;class:=DUIViewWndClassName", $treescope_children)
_UIA_Action($oP3,"setfocus")
Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=Explorer Pane;controltype:=UIA_PaneControlTypeId;class:=HWNDView", $treescope_children)
_UIA_Action($oP2,"setfocus")
Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=Folder Layout Pane;controltype:=UIA_PaneControlTypeId;class:=Element", $treescope_children)
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=Shell Folder View;controltype:=UIA_PaneControlTypeId;class:=DUIListView", $treescope_children)
_UIA_Action($oP0,"setfocus")
_UIA_setVar("ItemsView.mainwindow","title:=Items View;classname:=UIItemsView")
_UIA_action("ItemsView.mainwindow","setfocus")

autoit screenshot.PNG

Link to post
Share on other sites
  • Developers

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

Are you aware of excel udf where you directly can do a workbook.saveas in right location. Then no need for struggle with gui automation.

https://www.autoitscript.com/autoit3/docs/libfunctions/_Excel_BookSaveAs.htm

Search for listview and uiautomation and you will find examples. Search also for virtual listview if you have more items then shown on screen.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...