I've made a script that will set an environment variable to the path in the current Explorer windows when its hotkey is pressed. However, I want this to only trigger if the active window is an Explorer window. This should do it:
#IfWinActive ahk_class ExploreWClass|CabinetWClass #p:: SetPath() return #IfWinActive
But for some reason it isn't. Is there something I'm doing wrong?