applemusicrp icon indicating copy to clipboard operation
applemusicrp copied to clipboard

(Windows) iTunes re-opening itself

Open wxllow opened this issue 2 years ago • 5 comments

If you close iTunes while AppleMusicRP is running, it will reopen itself.

The code that handles this and causes this is here

wxllow avatar Apr 23 '22 16:04 wxllow

Was scrolling through GitHub and found this issue,

When integrating win32com to iTunes, it will always attempt to find that process, even if it is closed. This causes the effect of reopening the program.

Fixing it should be easy enough. Within the win32com documentation (should be) instructions on how to kill a dispatch hook. Simply killing it will make sure it doesn't spawn again. Implementation is as easy as setting a flag for hooking to iTunes for the first time since the program is ran, and then killing the win32com variable as soon as iTunes is not detected.

benjjvi avatar Jun 07 '22 19:06 benjjvi

Was scrolling through GitHub and found this issue,

When integrating win32com to iTunes, it will always attempt to find that process, even if it is closed. This causes the effect of reopening the program.

Fixing it should be easy enough. Within the win32com documentation (should be) instructions on how to kill a dispatch hook. Simply killing it will make sure it doesn't spawn again. Implementation is as easy as setting a flag for hooking to iTunes for the first time since the program is ran, and then killing the win32com variable as soon as iTunes is not detected.

Thank you for this! I'll try it soon

wxllow avatar Jun 08 '22 00:06 wxllow

Thank you for this! I'll try it soon

Any luck so far?

benjjvi avatar Jun 11 '22 16:06 benjjvi

on windows, you can kill the task with a simple vbs script.

Set WshShell = CreateObject("WScript.Shell") WshShell.Run "taskkill /f /im AppleMusicRP.exe"

save as stopAppleMusicRP.vbs

pebxcvi avatar Apr 15 '23 21:04 pebxcvi

on windows, you can kill the task with a simple vbs script.

Set WshShell = CreateObject("WScript.Shell") WshShell.Run "taskkill /f /im AppleMusicRP.exe"

save as stopAppleMusicRP.vbs

that would be a good idea to bodge, but it would probably be easier to just implement it directly into the script. i haven't been here for a while as ive been working on my own version, but we use the same library.

benjjvi avatar Apr 16 '23 11:04 benjjvi