Safari Trigger Built-in Picture in Picture (v9.2)

These macros require Safari tab in which target PiP video hosted on to be active, a video is active and the tab is unmuted. You then press ⌃⌘P to toggle on/off built-in PiP.

Macro Lists:

Also install this dependency macro

Trigger PiP Macro (v9.2)

Safari: Get Item Name Macro (v9.2)


I also have Macro to send to IINA, but it relies on positioning the IINA Safari extension precisely like mine, so it's not as versatile.

If you feel adventurous, this is the base macro for IINA:

Trigger PiP with IINA.kmmacros (6.2 KB)

Trigger PiP with IINA (v9.2)

1 Like

Hi @ybbond, a very good idea.

I have solved this on my iMac 27 inch with a palette. In combination with BetterTouchTool I always have this at the cursor.


#PiP Safari Macros <623A 210710T215346>.kmmacros (29,5 KB)

I have set up the same workflow for IINA, the VLC player and the Movist app.


That method with palette looks neat! It looks great with your provided icon too. Sadly I tested running your macro by name (I have no Magic Mouse, is it good?) and it fails.

Anyway, I updated my script to work with full AppleScript and require no dependency:

Safari: Trigger PiP Macro (v9.2)

Trigger PiP.kmmacros (5.4 KB)

I also make the IINA version more robust, though you still need IINA extension to be active:

Trigger PiP with IINA Macro (v9.2)

Trigger PiP with IINA.kmmacros (3.8 KB)

also, with the same method as Picture in Picture, I've made a "Toggle Mute" macro:

Toggle Mute Macro (v9.2)

Toggle Mute.kmmacros (4.8 KB)

It's fun creating those macros. I love Keyboard Maestro :heart:

I updated again the macro for built-in Safari PiP. This should increase the performance, so I reduced the timeout to be 3 seconds.

Because I dog-food this macro, there are chances that I will improve this script as my knowledge on AppleScript increases. In that case, please check this GitHub Gists. Of course I will post the updates here too.

Execute an AppleScript Action v1.03

Execute an AppleScript.kmactions (2.8 KB)

@ybbond here you can copy & paste the icons into KM

You can install Beta 3 or version 2.1 (a bit further down).

The best setting is SF Pro with Ultralight:

1 Like

@ybbond can you post the modified macro? Then I can help you for sure.

1 Like

ooooh, that's SF Symbols! That explains the sharpness and good design.

thanks for the offer. I don't modify the Macros (nor Macro Group), I just call the "PIP" macro with Keyboard Maestro's trigger by name. The error notification looks like it cannot find the 'blue sound icon' unique image in my screen.

1 Like

I updated the AppleScript for both PiP and Mute. Now it's even more efficient and less conditional lookup. Updated the GitHub Gist too.

Safari: Trigger PiP Macro 1.04

Safari- Trigger PiP.kmmacros (5.3 KB)

Safari: Toggle Mute Macro 1.01

Safari- Toggle Mute.kmmacros (5.1 KB)

@ybbond when you start a video in Safari (14.1.1), a blue speaker icon (red arrow) appears at the top of the URL line. This is the screenshot in my macro.