I have a script that needs to activate iTunes. I’d like to launch it with a keyboard shortcut or trackpad gesture without leaving whatever app I might be running. So, I have it saved as an application bundle, and I configured Better Touch Tool to launch it. However, I can’t figure out how to have it switch back to the app I was using when I launched it.
with, at the end:
but this doesn’t behave as I hoped. In both cases, frontapp gets set to the app bundle for the script. I’ve considered having it use the app switcher (cmd+tab) after it’s finished, but this isn’t my desired behavior if I launch it from within iTunes. One thing that would do the trick would be the “second frontmost” app.
Any suggestions? I can post my full code if it’s useful.