I have two windows open on my MacBook. One on the MacBook itself another one on the external display. I would like to play/pause YouTube videos playing on the external display while taking notes on my MacBook. Above script works only if the windows on the MacBook is activated because it is specifically pointing to the other window via
I think I need to find all windows and somehow use the
repeat operator so that I can play/pause the video regardless of which window is activated. But I am not sure how to approach.
Any help is appreciated!
PS. I have added this script as a Service and assigned a specific key combination. So when I am taking notes on my MacBook I can quickly play/pause the video.
Source: Windows Questions