Armand Posted July 21, 2008 Share Posted July 21, 2008 hey there, I've read the FAQ and yet it remains a mystery to me... i can associate a file with my script and it works... as i click on the file twice it runs my script and sends the params to it as should... however, i want the associated file to work with my script also after it was ran.... Eg: #A. I double click my file "toxins.bui" => compiled script is launched, it recognises the $CmdLine[$n] and it acts accordingly. #B. As the compiled script is still runing i double click "toxins.bui" again and it runs a second instance of my compiled script. *>> I want it not to run the script over and over again, but instead to send the parameters to the already active script, how do i do that ? [line in WinAmp... when you double click a .mp3 file, it just adds it in the list instead of opening a new winamp instance...] [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 21, 2008 Share Posted July 21, 2008 hey there, I've read the FAQ and yet it remains a mystery to me... i can associate a file with my script and it works... as i click on the file twice it runs my script and sends the params to it as should... however, i want the associated file to work with my script also after it was ran.... Eg: #A. I double click my file "toxins.bui" => compiled script is launched, it recognises the $CmdLine[$n] and it acts accordingly. #B. As the compiled script is still runing i double click "toxins.bui" again and it runs a second instance of my compiled script. *>> I want it not to run the script over and over again, but instead to send the parameters to the already active script, how do i do that ? [line in WinAmp... when you double click a .mp3 file, it just adds it in the list instead of opening a new winamp instance...] I think you would have to detect the condition with _Singleton(), pass the new file to the first instance via interprocess comms (WM_COPYDATA message, write to a hidden control, etc.), and then exit the second instance. It sounds like fun! If I get a moment this evening I'll code a demo. muttley Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
James Posted July 21, 2008 Share Posted July 21, 2008 If ProcessExists("program.exe") Then OpenInSameWindow() Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 21, 2008 Share Posted July 21, 2008 If ProcessExists("program.exe") Then OpenInSameWindow() The problem with that is the first instance will see itself with ProcessExists(), so that doesn't tell you if there is more than one running. You could use $avProcList = ProcessList("program.exe") If $avProcList[0] > 1 Then ... But that will change behavior based on compiled/uncompiled script. That's why _Singleton() make sense for this. muttley Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Armand Posted July 22, 2008 Author Share Posted July 22, 2008 (edited) Oky, Fixed.... Sorry for Bump.... Edited July 22, 2008 by Armand [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! 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