xxd2godxx Posted February 10, 2006 Share Posted February 10, 2006 I am trying to make a script that will open a .ini script, then it will wait untill i close it. Then the script will open a different script that i need to edit and it will wait untill the script is closed. Then it will install a file to a directory. I KNOW HOW TO DO EVERYTHING EXCEPT OPEN A .INI FOR EDITING!!! It can not be the run function because i have to use @ScriptDir which won't work with Run. -matt Link to comment Share on other sites More sharing options...
cdkid Posted February 10, 2006 Share Posted February 10, 2006 (edited) umm... an INI file is not a script, but if u want to edit one right click > open with > notepad...lookup IniRead() IniReadSection() IniWrite() in the helpfile or to open one with autoit use $file = @ScriptDir & "\settings.ini" $file = FileGetShortName($file) Run(@comspec & " /c start " & $file, '', @SW_HIDE) --hope this helps ~cdkid Edited February 10, 2006 by cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
pecloe Posted February 10, 2006 Share Posted February 10, 2006 here's the answer to part of your question #include <GuiConstants.au3> ;Opt("TrayIconDebug", 1) ;************ NOTES START ************ ;************ NOTES END ************** $INIPATH = @ScriptDir & "\test.ini" GUICreate("", 200, 230, -1, -1, $WS_DLGFRAME, $WS_EX_TOPMOST) GUISetBkColor(0xffff00) GUISetFont(11, 690) $OPEN = GUICtrlCreateButton("Open ini", 10, 160, 80, 25) $CANC = GUICtrlCreateButton("Exit", 110, 160, 80, 25) GUISetState() While 1 $MSG = GUIGetMsg() Select Case $MSG = $CANC Exit Case $MSG = $OPEN GUIDelete() Run("C:\Windows\Notepad.exe" & " " & $INIPATH) If Not WinWaitActive("test.ini - Notepad", "", 5) Then Exit Sleep(500) If Not WinWaitClose("test.ini - Notepad", "", 300) Then Exit If @Compiled = 1 Then Run( FileGetShortName(@ScriptFullPath)) Else Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)) EndIf Exit EndSelect WEnd Link to comment Share on other sites More sharing options...
xxd2godxx Posted February 10, 2006 Author Share Posted February 10, 2006 One more question, how do i make the script sleep untill the .ini is closed, then it will open a new file? Link to comment Share on other sites More sharing options...
GrungeRocker Posted February 10, 2006 Share Posted February 10, 2006 what about making a do until loop with checking if it was closed?dont forget to make sth like sleep(10) else it would blow your CPU! [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
Valuater Posted February 10, 2006 Share Posted February 10, 2006 (edited) use RunWait... instead of Run 8) Edited February 10, 2006 by Valuater Link to comment Share on other sites More sharing options...
pecloe Posted February 10, 2006 Share Posted February 10, 2006 (edited) like Valuater said use runwait, but if you'll look at this line If Not WinWaitClose("test.ini - Notepad", "", 300) Then Exit it is waiting for test.ini to close (300=5 min) you don't need the timeout option. WinWaitClose("test.ini - Notepad") will wait foreever have you tried the script i provided to see how it works ? make up a test ini phil Edited February 10, 2006 by pecloe 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