raycast / script-commands

Script Commands let you tailor Raycast to your needs. Think of them as little productivity boosts throughout your day.

Home Page:https://raycast.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toggle Screen Mirroring to a device

theopavlove opened this issue · comments

commented

How should be the Screen Mirroring macOS system feature implemented so that it would be possible to select a device I want to mirror to from a list?

After a brief search through the extension store and github repos I haven't found any solutions, so I believe it needs to be written from scratch. I don't have any experience in scripting for the Raycast yet so I'd be glad if someone could suggest where to start.

Hey @theopavlove,

You need to use AppleScript for that, since there is no public APIs to do that programmatically (as far as I am aware). We used to have an AppleScript (simulating mouse clicks) for toggling sidecar which could be easily tweaked to do the mirroring; however Apple changed the whole System Settings in macOS 13 and that script doesn't work anymore.

If you are interested, you could learn AppleScript and try to figure it out yourself, but AppleScript is a huge pain and I am sadly no expert. You may have more luck asking for help with AppleScript in our Slack community or somewhere else in the internet (Raycast just run an AppleScript, therefore the script is not specific to Raycast).