yabbadabbadoo Posted June 21, 2014 Posted June 21, 2014 Hi This script randomly worked once, but I have never been able to get it to work again... I can't see what the possible problem is. The path is most certainly correct. Any help would be greatly appreciated. Otherwise I have to install 100+ files individually. ------------------------------------------ #include <File.au3> #include <Array.au3> AutoItSetOption ("WinTitleMatchMode", 1) AutoItSetOption ("WinTextMatchMode", 2) AutoItSetOption ("TrayIconDebug", 1) $folder = "F:MUSIC SOFTWAREBIABTRACKSREALTRACKS" Local $files = _FileListToArray($folder, "*") For $i = 1 to UBound($files) install($files[$i]) Next Func install($file) $pid = Run($file) WinWait("Setup - RealTracks", "Welcome to the RealTracks") Send("!n") WinWait("Setup - RealTracks", "Please read") Send("!a") Send("!n") WinWait("Setup - RealTracks", "When you are ready") Send("!n") WinWait("Setup - RealTracks", "Where should") Send("!n") WinWait("Setup - RealTracks", "Setup is now ready") Send("!i") WinWait("Setup - RealTracks", "Completing") Send("!f") ProcessWaitClose($pid) EndFunc ------------------------
somdcomputerguy Posted June 21, 2014 Posted June 21, 2014 (edited) Hello, welcome to the forum. It will probably only work correctly if the program you are starting has focus the whole time the script is running. This is because you are using Send instead of ControlSend. Refer to the Help file about these two functions, the AU3 Window Info Tool, and other Control functions that you may be able to use. As long as you are reading these particular segments, you might as well read the whole thing two or a hundred times, and become more familiar with the AutoIt language. Also, when you post code, it is best to enclose it in autoit code tags. That is the little blue button with the A in it, or just use [ autoit ] at the top of your code, and [ /autoit ] at the end. I added the spaces and bold to make this text more visible to you. Neither spaces or boldness is needed in use, I just used them to make it more visible to you. Edited June 21, 2014 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
yabbadabbadoo Posted June 21, 2014 Author Posted June 21, 2014 Thanks for the reply I forgot to add that, according to the debug, it doesn't even get to the first send, but instead hangs on the first winwaitactive line. Does this make a difference to your suggestion?
somdcomputerguy Posted June 21, 2014 Posted June 21, 2014 How do you know it's 'hanging' on the first WinWait, and not the Send after it? Use the MsgBox or ConsoleWrite functions thru out your code to display 'where it's at'. Like this: WinWait("Setup - RealTracks", "Welcome to the RealTracks") MsgBox(0, '', 'first Winwait done..') Send("!n") MsgBox(0, '', 'first Send done..') - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
JohnOne Posted June 21, 2014 Posted June 21, 2014 AutoItSetOption ("TrayIconDebug", 1) shows exactly which line the script is currently on in the system tray. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
yabbadabbadoo Posted June 21, 2014 Author Posted June 21, 2014 Yes I have that and it is definitely the first WinWaitActive.
yabbadabbadoo Posted June 21, 2014 Author Posted June 21, 2014 It doesn't Run the first file... I checked with $msg = '' For $i = 1 to UBound($files) -1 $msg &= String($files[$i]) $msg &= ' ' Next MsgBox(0, '', $msg) And all the files are correct...so why does it not start the Run? Frustrating.
yabbadabbadoo Posted June 21, 2014 Author Posted June 21, 2014 (edited) Fixed! Just needed to add the folder...duh... install($folder&$files[$i]) :-) Edited June 21, 2014 by yabbadabbadoo
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