Screen Mirroring Shortcut?

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,928
Reaction score
1,352
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Sequoia, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
Our school district has issued MacBook Air notebooks for our teachers to use. Most of our teachers had little/no Mac experience prior to being issued the machines. Things have gone pretty well for the most part but I'd like input on the best way to automate something (if possible).

Many of the classrooms also have the current Apple TV device attached to interactive whiteboards. Since the Macs and Apple TVs are on the same wireless network the MacBook Air screen can be mirrored to the whiteboard or (theoretically) a whiteboard in another classroom since they appear in the list when you turn on screen mirroring.

For ease of use/convenience I'd like to create an easy way to do the following:

1. Activate screen sharing and choosing either mirrored/extended mode.
2. Choose the target whiteboard.

Thoughts?
 
Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,236
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
Unless there's a simple menubar app that can do this, your best bet is to create an Automator workflow that clicks all the buttons for you. Here's a walkthrough of how to do this on Apple's forums.

I would save this as an Application (the tutorial says to create a Service, but I think an app would be easier), then add it to the Dock for one-click access. It will have a generic icon, but you could change that with something of your choosing easily enough if you have an icon in mind.

EDIT: I just tried this myself, but I get errors. The tip is pretty old and while conceptually it should work, the exact flow in that post is probably outdated for Monterey. I don't know how to fix, but maybe this will get you on the right track.
 
Last edited:
Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,236
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
It occurred to me that this may be a bit overcomplicated even if you work out the script due to multiple ATVs in use. So I just tried something, and CHA-CHING! So here on Monterey... you have the Control Center icon on the menubar that lumps a variety of controls on the one menu. So do this: open up that menu; hover your mouse over the Screen Mirroring button; press and hold the COMMAND key; drag that button to the menubar. And BAM! You have the Airplay menu on its own. If you do this, the teachers can simply select their classroom's ATV off that menu, easy access.
 
OP
S

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,928
Reaction score
1,352
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Sequoia, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
I looked at using the Shortcuts app to do this since that seems to be Apple's currently preferred method for automating things. So far I haven't found anything.

I have used Automator before so I should be able to figure things out. I still have a shortcut I built up to launch iTunes and play specific musical genres.

I also built up a series of actions connected by AppleScript that looked at my contacts and sent an email to anyone who had a birthday. It could also give me as much as a month's notice in case I wanted to plan a party. That one got noticed by someone at Apple. I haven't used that one in some time because Apple made a change that broke one of the action steps I used.
 
OP
S

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,928
Reaction score
1,352
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Sequoia, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
It occurred to me that this may be a bit overcomplicated even if you work out the script due to multiple ATVs in use. So I just tried something, and CHA-CHING! So here on Monterey... you have the Control Center icon on the menubar that lumps a variety of controls on the one menu. So do this: open up that menu; hover your mouse over the Screen Mirroring button; press and hold the COMMAND key; drag that button to the menubar. And BAM! You have the Airplay menu on its own. If you do this, the teachers can simply select their classroom's ATV off that menu, easy access.
Wow. That is brilliant and sounds like just what I need. I have Control Center in my menu bar but never thought to try that as away to directly select the target device.
 
Joined
Oct 16, 2010
Messages
18,146
Reaction score
1,899
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2020 27" i9 5K nano iMac, 1TB(partitioned) SSD, GB, macOS 15.3.1 Sequoia
That one got noticed by someone at Apple. I haven't used that one in some time because Apple made a change that broke one of the action steps I used.

Why on Earth would they bother to do that other than wasting some programmers time???

Hopefully you can get what you want done using Control Center and hope that Apple doesn't see it and screw it up as well or stop it from working with some sort of update. Not too helpful.

Googling your question provides many hits but also many problems getting some things to consistently work using Automator or Apple Script.





- Patrick
=======
 
OP
S

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,928
Reaction score
1,352
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Sequoia, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
Thanks for that search Patrick. Thus far I had confined my search to the Shortcuts app since that seems top be the preferred method now.

Automator was never quite as good as it could have been. Once the initial excitement died down it seemed like there were fewer and fewer action steps available. Automator had the ability to run scripts (AppleScript, Terminal, etc.) but I was never good enough at scripting/programming to build the steps I needed.

Besides my fear/abhorrence of Terminal commands is legendary on these forums.
 
Joined
Oct 16, 2010
Messages
18,146
Reaction score
1,899
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2020 27" i9 5K nano iMac, 1TB(partitioned) SSD, GB, macOS 15.3.1 Sequoia
Automator was never quite as good as it could have been

Unfortunate, and I must agree with you 100% and there always seem to be something that got in the way for most scripts I was able to create to work properly or something would get unsupported and stop working in a later Mac OS X version on top of the fact that my programming knowledge was pretty basic and minimal and something always got in the way whenever I tried to improve my programming abilities.

So I basically ended up using what scripts some good programmers kindly shared with maybe a small modification. I always wished I had been able to take a programmers course, but at University in the early sixties, it was almost non-existent until the middle of the decade when maybe the word Fortran was whispered among a few select students and a Prof who was willing to provide some of his time to help instruct.

Are there any sort of Mac forums for teachers that have such information to share for what you are wanting to do??? There must be others wanting to do similar things and maybe somebody out there has an answer already, or does one have to sort of reinvent the wheel again to go along with Apples apparent "new and improved" changes???

Anyway, good luck with your project and I'm sorry I could not help better.




- Patrick
=======
 
OP
S

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,928
Reaction score
1,352
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Sequoia, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
There might well be such a site out there that I have not stumbled upon yet. Apple periodically has online courses available to teachers and I did a couple of the presentations this past Summer. They tend to focus on applying Apple tech to the lessons rather than on this kind of issue.

Because I'm familiar with the settings that need to change to enable screen mirroring it never dawned on me that this might not be easy for everyone. After school one day last week I helped someone set their's up and it dawned on me that it would be nice to automate the settings changes.

I need to get back into creating videos for some of our teachers.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top