eitrnel Posted February 2, 2009 Share Posted February 2, 2009 (edited) hi ! i need script that will do the following: first it will read info from a text file (lets say it will be numeric - '1' or '2') if the number is '1' it will press F8, minimize file named 'media.exe' (this fie is always running on background), and then it will open file named '1.exe' and run it for 15 minutes, and change the value on the text file to '2' and if the number is '2' it will close file named '1.exe, Press F8, and maximize 'media.exe' and change the value in the text file to '1' i hope i was clear tnx! Edited February 2, 2009 by eitrnel Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 2, 2009 Moderators Share Posted February 2, 2009 eitrnel,Hello and welcome to the AutoIt forums. You will find lots of help here, but we do expect you do do some work first.Go and read the Help file and the excellent tutorials that you can find here and here. Then when you have some code, even if it does not work, come back and ask for help again. You will be amazed at the difference!M23Hint: Start by looking at the following functions:FileOpen, FileRead, FileWrite, FileClose, Send, WinSetState, Run, WinClose, TimerInit, TimerDiffThat should get you started! ;-) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Authenticity Posted February 2, 2009 Share Posted February 2, 2009 HotKeySet('{ESC}', '_EXIT') Dim $sTxt, $iInterval = 60*1000 Dim $sTitle, $hWin $sTxt = FileRead(@ScriptDir & '\Test.txt', 1) $sTitle = '' $hWin = WinGetHandle($sTitle) While 1 If $sTxt = '1' Then Send('{F8}') WinSetState($hWin, '', @SW_MINIMIZE) Run(@ScriptDir & '\1.exe') Sleep(15*$iInterval) Else If $sTxt = '2' ProcessClose('1.exe') Send('{F8}') WinSetState($hWin, '', @SW_MAXIMIZE) EndIf EndIf Sleep(20) WEnd Func _EXIT() Exit EndFunc I didn't bother to check this as I don't know what is the title of media.exe window. Link to comment Share on other sites More sharing options...
eitrnel Posted February 2, 2009 Author Share Posted February 2, 2009 (edited) Melba23 - youy right, im gonna read the Help file Authenticity - thanks, ill chek it out Edited February 2, 2009 by eitrnel Link to comment Share on other sites More sharing options...
eitrnel Posted February 3, 2009 Author Share Posted February 3, 2009 Im backkkk ok, so i got this codeProcessClose("1.exe")WinSetState($hWin, '', @SW_MAXIMIZE)Send('{F8}')Sleep((5) * ($iInterval)) but 1.exe wont close, it's still on the backgroundany ideas? Link to comment Share on other sites More sharing options...
BrettF Posted February 3, 2009 Share Posted February 3, 2009 Post the full code Maybe try ProcessWaitClose? Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
eitrnel Posted February 3, 2009 Author Share Posted February 3, 2009 Post the full code Maybe try ProcessWaitClose?Cheers,Brettstill not working here's the codeCODEHotKeySet('{ESC}', '_EXIT')Dim $sPresToShow, $iInterval = 60*1000Dim $sTitle, $hWin$sPresToShow = 1$sTitle = ''$hWin = WinGetHandle($sTitle)while True if $sPresToShow > 3 then $sPresToShow = 1 endif Send('{F8}') WinSetState($hWin, '', @SW_MINIMIZE) Run("1.exe") $sPresToShow = $sPresToShow + 1 Sleep((1) * ($iInterval)) ProcessClose("1.exe") WinSetState($hWin, '', @SW_MAXIMIZE) Send('{F8}') Sleep((5) * ($iInterval)) WEnd Func _EXIT() ExitEndFunc Link to comment Share on other sites More sharing options...
eitrnel Posted February 5, 2009 Author Share Posted February 5, 2009 UP? Link to comment Share on other sites More sharing options...
eitrnel Posted February 5, 2009 Author Share Posted February 5, 2009 ok! i understand my problem i closed another process instead of mine so, i got another questionhow do i make this code to be correct with autoit SyntaxRun("Variable.exe")("Variable" is a variable number of course, and not specific name of file)tnx guys!! Link to comment Share on other sites More sharing options...
Inverted Posted February 5, 2009 Share Posted February 5, 2009 (edited) Very easy : $var1 = 111 MsgBox (4096, "Test", "c:\" & $var1 & ".exe") Edited February 5, 2009 by Inverted Link to comment Share on other sites More sharing options...
eitrnel Posted February 6, 2009 Author Share Posted February 6, 2009 Very easy : $var1 = 111 MsgBox (4096, "Test", "c:\" & $var1 & ".exe") tnx man! work like magic Link to comment Share on other sites More sharing options...
eitrnel Posted February 8, 2009 Author Share Posted February 8, 2009 (edited) So, i got another question!how do i mute entire column in the Master Volume (or Mixer)?there is any custom function for this?let's say i want to mute Skypetnx! Edited February 8, 2009 by eitrnel Link to comment Share on other sites More sharing options...
BrettF Posted February 8, 2009 Share Posted February 8, 2009 Take a look at volly's sound UDF. cheers, brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
eitrnel Posted February 9, 2009 Author Share Posted February 9, 2009 Tnx! but in Vista it's little bit different cuz every application has its own column Link to comment Share on other sites More sharing options...
eitrnel Posted February 15, 2009 Author Share Posted February 15, 2009 (edited) is some one know how to deal with this situation?So, i got another question!how do i mute entire column in the Master Volume (or Mixer)?there is any custom function for this?let's say i want to mute Skypetnx! Edited February 15, 2009 by eitrnel 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