I'm a little new to scripting but i'm a power google user so bear with me.
I'm attempting to create a macro that switches windows to Spotify and sends the space bar which should pause/play. Spotify doesn't support global hotkeys so the window must be in focus.
I attempted the following:
Code: Select all
Dim wsh Set wsh = CreateObject("Wscript.Shell") wsh.AppActivate "Spotify" SendKeys " "
The problem is when Spotify starts playing something, the window title (as per script tools) changes to the artist and song, even though windows task manager lists the process as "Spotify".
Is there a way i can call the process name instead of the window title?