i took all day to figure it out what's wrong with my script,
do i need to put
Code: Select all
file=
about the Sleep time: i'm trying to put some delay to test if this is the speed causing the problem
about the Clipboard:= and Sendinput, ^v : i need to input the string in uppercase(formatted in script), i found that if i use "Sendinput, string", it seems randomly input in lowercase, and i also found copy/paste might be reliable than sendinput.
Code: Select all
; something
Loop F:\1\2b\1\*.*
If ( A_LoopFileTimeModified >= Time )
Time := A_LoopFileTimeModified, Filename := A_LoopFileName
Sleep 300
StringTrimRight, Filename, Filename, 4
Sleep 300
if( RegExMatch(Filename, "(.*?)(\d+)$", spli) )
Sleep 300
spli2 := spli2 +1
Sleep 500
Loop F:\1\2b\1\*.*
If ( A_LoopFileTimeModified >= Time )
Time := A_LoopFileTimeModified, File := A_LoopFileFullPath
Sleep 200
run, %File%
WinWait, FH
WinWaitActive, FH
Sleep 1500
XL := Excel_Get()
;do something
SendInput, {F12}
WinWait, Save As
WinWaitActive, Save As
Sleep 1000
Clipboard := spli1 . spli2
Sleep 200
SendInput, ^v
Sleep 200
SendInput, {Enter}
Sleep 1500
SendInput, !{F4}
Sleep 1000
Loop F:\1\2b\2\*.*
If ( A_LoopFileTimeModified >= Time )
Time := A_LoopFileTimeModified, Filename := A_LoopFileName
Sleep 300
StringTrimRight, Filename, Filename, 4
Sleep 300
if( RegExMatch(Filename, "(.*?)(\d+)$", spli) )
Sleep 300
spli2 := spli2 +1
Sleep 500
Loop F:\1\2b\2\*.*
If ( A_LoopFileTimeModified >= Time )
Time := A_LoopFileTimeModified, File := A_LoopFileFullPath
Sleep 200
run, %File%
WinWait, FH
WinWaitActive, FH
Sleep 1500
XL := Excel_Get()
;do something
SendInput, {F12}
WinWait, Save As
WinWaitActive, Save As
Sleep 1000
Clipboard := spli1 . spli2
Sleep 200
SendInput, ^v
Sleep 200
SendInput, {Enter}
Sleep 1500
SendInput, !{F4}
Sleep 1000
Loop F:\1\2b\3\*.*
If ( A_LoopFileTimeModified >= Time )
Time := A_LoopFileTimeModified, Filename := A_LoopFileName
Sleep 300
StringTrimRight, Filename, Filename, 4
Sleep 300
if( RegExMatch(Filename, "(.*?)(\d+)$", spli) )
Sleep 300
spli2 := spli2 +1
Sleep 500
Loop F:\1\2b\3\*.*
If ( A_LoopFileTimeModified >= Time )
Time := A_LoopFileTimeModified, File := A_LoopFileFullPath
Sleep 200
run, %File%
WinWait, FH
WinWaitActive, FH
Sleep 1500
XL := Excel_Get()
;do something
SendInput, {F12}
WinWait, Save As
WinWaitActive, Save As
Sleep 1000
Clipboard := spli1 . spli2
Sleep 200
SendInput, ^v
Sleep 200
SendInput, {Enter}
Sleep 1500
SendInput, !{F4}
Sleep 1000