Hi guys, this is my script:
$File1 = @WorkingDir & "\Test1.txt"
$File2 = @WorkingDir & "\Test2.txt"
$FileNameEstension = StringTrimLeft($File2, StringInStr($File2, "\", 0, -1))
$FileNameOnly = StringTrimRight($FileNameEstension, 4)
ClipPut(FileRead($File1))
Start($File2)
func Start($File2)
If Not FileExists($File2) Then Return 0
Return Run(@ComSpec & " /c " & "start " & FileGetShortName($File2),"",@SW_HIDE)
endfunc
If WinActive($FileNameOnly & " - Notepad") Then Send("^v")
Send("^s")
WinClose($FileNameOnly & " - Notepad")
First, would know if you can merge this part into a single string:
$FileNameEstension = StringTrimLeft($File2, StringInStr($File2, "\", 0, -1))
$FileNameOnly = StringTrimRight($FileNameEstension, 4)
The first line give me Test.txt, the second remove the extension. I try to connect with "&" but not work.
The script don't work becouse don't recognize the window name: WinActive($FileNameOnly & " - Notepad")
I don't know what is the problem. Thanks for support