Help with Singleinstance
Re: Help with Singleinstance
Excellent! I am not connected to the foundation but still thank you for your generosity!
Re: Help with Singleinstance
Thank you so much.
So, I have encountered another tiny problem and I hope you don't think I'm being ridiculous.
Every time the action is taking place there's a TIK sound that the script or the computer generates.
I've made a short clip to demonstrate this. I used notepad. As you can see and hear there's a Tik sound every time the previous window is closed
When a recording is made with other programs (like mp3 recorder) this sound is actually heard and overall is annoying.
Can you check this and see why this is happening? Here's the short clip
https://youtu.be/ANd3Ub-TNq8
So, I have encountered another tiny problem and I hope you don't think I'm being ridiculous.
Every time the action is taking place there's a TIK sound that the script or the computer generates.
I've made a short clip to demonstrate this. I used notepad. As you can see and hear there's a Tik sound every time the previous window is closed
When a recording is made with other programs (like mp3 recorder) this sound is actually heard and overall is annoying.
Can you check this and see why this is happening? Here's the short clip
https://youtu.be/ANd3Ub-TNq8
Re: Help with Singleinstance
Remove this line from the code:
Code: Select all
SoundBeep, 1500, 30
Re: Help with Singleinstance
Incredible!
Thank you so much.
I have another challenge. I hope you'll be able to provide some insights
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=82789
Thank you so much.
I have another challenge. I hope you'll be able to provide some insights
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=82789
Re: Help with Singleinstance
Thank you all for this thread! I've just used the script provided by @mikeyww to successfully close an unwanted second instance of a program I use every day.
I have a question. If I wanted the script to abort/prevent the opening of the second (new) instance instead of closing the one that's already open, would it be a matter of replacing the variable in the WinClose line or would a different script altogether be better for that?
While this script is wonderful for some programs such as Notepad that open and close very quickly, I'm dealing with a sluggish program that takes a while to open and close, so it would be better simply stop the second instance from running at all.
Thank you in advance!
I have a question. If I wanted the script to abort/prevent the opening of the second (new) instance instead of closing the one that's already open, would it be a matter of replacing the variable in the WinClose line or would a different script altogether be better for that?
While this script is wonderful for some programs such as Notepad that open and close very quickly, I'm dealing with a sluggish program that takes a while to open and close, so it would be better simply stop the second instance from running at all.
Thank you in advance!
Re: Help with Singleinstance
A possible approach: when a window is created, use WinGet to see whether more than one window exists for the window's process name. If so, close the older window, or the newer one. WinGet will get the window handles for matching windows, from top to bottom.