I've discovered that I can't use Separate> or Position> to acquire the location of an "x" if it comes from a window title and is surrounded by numbers. I.e. If a window title contains the text "22x33", Separating the title text using an "x" as the delimiter will not divide the text into two parts. If I set a variable to "22x33" and separate using "x" as the delimiter It works just fine.
After more testing it turns out that a number in the name anywhere will prevent separating by "x".
Try this:
1) Open Notepad and save a file with a name "test 1234 this x.txt"
2) Run the following script.
3) Make the notepad window the focused window.
4) With a delimiter of lower case x nothing will happen in the dialog box.
5) Close the script
6) Edit the script changing the separate delimiter to lower case t
7) Run the script
8) Make the notepad window the focused window.
9) Observe the results of separating by something other than lower case x.
Thanks to anyone who figures this out or tells me what I'm doing wrong...
Code: Select all
Dialog>Dialog1
Caption=Dialog1
Width=445
Height=250
Top=0
Left=0
Button=Ok,176,160,75,25,3
Label=msLabel1,24,8
Label=msLabel2,24,40
EndDialog>Dialog1
Show>dialog1
Label>start
GetDialogAction>dialog1,r1
If>r1=3,EOF
If>r1=2,EOF
GetActiveWindow>WinName,X,Y
//Change the delimiter in the next line//////////////
Separate>%WinName%,x,name
//Separate>%WinName%,t,name
If>%name_count%>1
Let>dialog1.mslabel1=%WinName%
Let>k=0
Let>dialog1.mslabel2=
Repeat>k
add>k,1
Let>value=name_%k%
Concat>dialog1.mslabel2,%value%%CRLF%
Until>k,%name_count%
EndIf
Wait>0.01
Goto>start
Label>EOF