g3wtter Posted November 6, 2019 Posted November 6, 2019 Hello, I am new to scripting and only have only very limited programming knowledge. What I want to do is create a script that will loop through the open windows of a programm and when the window count is <4 the script should open another window. The following lines work for the title: opt("WinTitleMatchMode", 2) $j = 0 $winlist = WinList() for $i = 0 to $winlist[0][0] if stringinstr($winlist[$i][0], "abc") then $j = $j + 1 endif I pretty much need something like this but for "CLASS:" as identfier since the title isnt specific enough.
seadoggie01 Posted November 6, 2019 Posted November 6, 2019 Hi and welcome! I would take a look at the Window Titles and Text (Advanced) section of the help file. ; Checks if a window with these properties exists: ; - RegExpTitle: the title matches .*abc.* (something abc something) ; - Class: matches your class ; - Instance: it's the fourth matching window WinExists("[REGEXPTITLE:.*abc.*;CLASS:myClass;INSTANCE:4]") g3wtter 1 All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now