Skip to content

Instantly share code, notes, and snippets.

@joshdavenport
Created April 29, 2023 21:17
Show Gist options
  • Select an option

  • Save joshdavenport/d6a38b7e5b9d9f1a76b0e44b78a7a5e5 to your computer and use it in GitHub Desktop.

Select an option

Save joshdavenport/d6a38b7e5b9d9f1a76b0e44b78a7a5e5 to your computer and use it in GitHub Desktop.

Revisions

  1. joshdavenport created this gist Apr 29, 2023.
    18 changes: 18 additions & 0 deletions pause-any-music.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    // Name: Pause Any Music
    // Description: Pause music playing from music apps
    // Author: Josh Davenport-Smith
    // Twitter: @joshdprts

    import "@johnlindquist/kit";

    const pauseScript = `
    tell application "Spotify"
    pause
    end tell
    tell application "Music"
    pause
    end tell
    `;

    exec(`osascript -e '${pauseScript}'`);