This is a not so amazing way to pull it off. Let's find a more elegant option, shall we? It's an Applescript that's currently a bit buggy, but I'm uploading it here, mostly to test the repo.
It's a bit wonky right now. See more on Github.
I have to give cred for the applescript to this post: https://secure.macscripter.net/viewtopic.php?pid=82734