Jump to content

[Solved] Wingettext - extract address


Recommended Posts

Hi,

I'm starting to work on a small script where it will display all open Explorer windows so you can select the window you want. Using Wingettext, it appears to use @CR instead of @CRLF.  I'm trying to extract the address. A messagebox shows this:

Quote

Address: C:\Users\Satellite\Desktop\backup autoit

backup autoit

Namespace Tree Control
Tree View

ShellView

However, writing it to a text file appears like this:

Quote

Address: C:\Users\Satellite\Desktop\backup autoitbackup autoitNamespace Tree ControlTree ViewShellView


I have tried some code like this:

$s = WinGetText("[ACTIVE]")
$a2 = StringSplit($s, @CR)
_ArrayDisplay($a2)
$s = StringReplace($s, @CR, @CRLF)
FileWrite("test.txt", $s & @CRLF)

 

I have also thought about using stringregex to extract the address, but I cannot think of any way to make that happen. How can I detect where the address ends and/or eliminate the text that comes afterwards?

Thanks!

Edited by abberration
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...