wol Posted July 10, 2006 Share Posted July 10, 2006 I'm trying to open one file at a time with sound recorder then do some work on it and save it as the same file name plus "temp" So far all it does is open the same file three times Can anyone see what is wrong...Thanks ; AutoIt Version: 3.1.0 ; Author: wol <wol6@hotmail.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here $n=1 for $n=1 to 50 step 1 Run("C:\WINDOWS\system32\sndrec32.exe") #region --- ScriptWriter generated code Start --- Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) WinWait("Sound - Sound Recorder","Position:") If Not WinActive("Sound - Sound Recorder","Position:") Then WinActivate("Sound - Sound Recorder","Position:") WinWaitActive("Sound - Sound Recorder","Position:") Send("{ALTDOWN}{ALTUP}{DOWN}{DOWN}{ENTER}") WinWait("Open","Files of &type:") If Not WinActive("Open","Files of &type:") Then WinActivate("Open","Files of &type:") WinWaitActive("Open","Files of &type:") sleep(2000) #region --- ScriptWriter generated code Start --- Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) WinWait("Open","Files of &type:") If Not WinActive("Open","Files of &type:") Then WinActivate("Open","Files of &type:") WinWaitActive("Open","Files of &type:") Send("{SHIFTDOWN}{TAB}{SHIFTUP}") Send("{DOWN},$n") $n=$n+1 Send("{enter}") next Link to comment Share on other sites More sharing options...
Zedna Posted July 10, 2006 Share Posted July 10, 2006 when you use $n variable in FOR $n = ... then don't try $n = $n + 1 manually Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
rbhkamal Posted July 10, 2006 Share Posted July 10, 2006 (edited) Maybe this will help you out.This is the save part only.Opt("WinTitleMatchMode", 4) Global $n For $n = 1 To 50 Step 1 Run("C:\WINDOWS\system32\sndrec32.exe") WinWait("Sound - Sound Recorder", "Position:") If Not WinActive("Sound - Sound Recorder", "Position:") Then WinActivate("Sound - Sound Recorder", "Position:") WinWaitActive("Sound - Sound Recorder", "Position:") ControlSend('Sound - Sound Recorder' , '' , 203 , "!f{s}") WinWait("Save As", "") If Not WinActive("Save As", "") Then WinActivate("Save As", "") WinWaitActive("Save As", "") Sleep( 500 ) ControlSetText( 'Save As' , '' , 1148 , ControlGetText( 'Save As' , '' , 1148 )&'_'&$n ) $Title = ControlGetText( 'Save As' , '' , 1148 ) & '.wav - Sound Recorder' ControlClick( 'Save As' , '' , 'Button2' ) WinWait( $Title , '' , 5 ) WinKill( $Title ) MsgBox( 0 , "Done" , 'File Number:'& $n , 3) Next Edited July 10, 2006 by rbhkamal "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix Link to comment Share on other sites More sharing options...
wol Posted July 10, 2006 Author Share Posted July 10, 2006 rbhkamal Thank you for your help...there is plenty for me to study I have been trying to do this for 3 or 4 days now...once again thank you Link to comment Share on other sites More sharing options...
rbhkamal Posted July 10, 2006 Share Posted July 10, 2006 rbhkamal Thank you for your help...there is plenty for me to study I have been trying to do this for 3 or 4 days now...once again thank youNo problem! RK "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix Link to comment Share on other sites More sharing options...
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