Guest CUStaffer Posted May 27, 2005 Posted May 27, 2005 I am writing a test script (this is a for a larger project) to open up windows explorer, prompt the user to input the directory and the script automatically goes to that directory. I don't know the syntax for the changing the directory. I use the "FileChangeDir" it did not seem to do much. Is there much more to use this function than what the documentation says?
GaryFrost Posted May 27, 2005 Posted May 27, 2005 quick and dirty example: Run ("Explorer c:\") sleep ( 1000 ) $title = WinGetTitle ("") ControlFocus($title,"","Edit1") ControlSend($title,"","Edit1",@ProgramFilesDir) ControlSend($title,"","Edit1","{Enter}") SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Valuater Posted May 27, 2005 Posted May 27, 2005 This should do the trick #include <GUIConstants.au3> $Window=Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & "XPCleanMenu.HostRocket.com\down.html") ;$Window=Run("iexplorer.exe"); used for testing Sleep(1000) WinWaitActive("","",20) Sleep(1000) $Input = InputBox("Find", "Type in what you would like to Search for ","C:\Program Files\Autoit3") Sleep(300) Send("{TAB}") Send($Input) sleep(500) Send("{ENTER}") Check it out......... Enjoy
Guest CUStaffer Posted May 27, 2005 Posted May 27, 2005 thanks a lot for the response! I'm gonna test the codes out and see what works well for me. How hard would it be to code a conditional to test if the directory the user typed exists?
GaryFrost Posted May 27, 2005 Posted May 27, 2005 If FileExists($Input) Then MsgBox(4096, "", $Input & " exists.") Else MsgBox(4096,"", $Input & " does not exist.") EndIf SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
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