keyboard – Applescript – create a shortcut to regulate a number of purposes concurrently?


I’ve two cases of the Quicktime software operating. I exploit two totally different video sources (Facetime digital camera and iPhone digital camera by way of USB), and I exploit “Film recording” to document them. I even have Spotify operating.

I wish to provoke “Document” in each Quicktime apps in addition to provoke the “Play” command on the Spotify app on the similar time by way of one key press.

I’ve learn this resolution utilizing Automator to create a Service with a shortcut right here

on run
    inform first doc of software "QuickTime Participant" to begin
finish run

I created a service for each QT apps and assigned the identical keyboard shortcut to begin each. I additionally assigned a shortcut to cease recording. After I examined, two issues occurred:

  1. Solely the second occasion of QT participant will document, regardless of which is within the foreground.
  2. After I stopped recording, a dialogue with “Ending Recording” got here up and wouldn’t disappear, though the recording was completed. This doesn’t occur when stopping the recording by clicking the on display cease button.

I then added Spotify utilizing the identical course of, with the identical keyboard mixture. Spotify will solely play when the QT apps are disabled in System Preferences.

I realise my strategy is flawed, however I’m unsure if there’s a technique to obtain this. Any assist can be appreciated!