Thanks for the answer. I have now solved it via the trigger, Activate Airplay. I don't want to switch my system from German to English.
greeting
Thanks for the answer. I have now solved it via the trigger, Activate Airplay. I don't want to switch my system from German to English.
greeting
Kein Problem! Für Zweisprachige oder solche, die mehrere Sprachen sprechen, ist es schwierig.
Das Problem ist, dass das Menü im Englischen "Display" heißt und nicht "Monitore". Wenn Du das in den jeweiligen AppleScripts austauscht, dann sollte es funktionieren.
In welchem Script ich das finden kann weißt du nicht zufällig?
Ich habe es gerade noch einmal getestet. Scheinbar ist bei einem deutschen System (oder dem Macbook Pro) noch ein Zwischenspeichern des Menüs notwendig. Sonst läuft es auf einen Fehler. Versuche es einmal hiermit:
tell application "System Events"
tell process "SystemUIServer"
try
set btMenu to (menu bar item 1 of menu bar 1 whose description contains "Monitore")
tell btMenu
click
tell (menu item 1 of menu 1 whose title contains "iPad")
click
end tell
end tell
on error
display dialog "Cannot find any iPads available right now"
end try
end tell
end tell
(in der Action "Apple Script starten …" des Buttons)
Leider weiterhin die Meldung Cannot find any iPads
Wird denn das Menü "Monitore" in der Menübar angezeigt und erscheint in diesem Dein iPad?
Dann muss es eigentlich gehen.
Eventuell hilft noch ein Delay:
tell application "System Events"
tell process "SystemUIServer"
try
set btMenu to (menu bar item 1 of menu bar 1 whose description contains "Monitore")
tell btMenu
click
delay 0.3
tell (menu item 1 of menu 1 whose title contains "iPad")
click
end tell
end tell
on error
display dialog "Cannot find any iPads available right now"
end try
end tell
end tell
Ansonsten wüsste ich dann auch nicht weiter.
Jetzt geht es, ich wußte nicht das ich die Option in der Menüleiste Anzeigen einstellen muss. Wenn man es deaktiviert hat funktioniert es nicht, das ist ja was.
Danke für deine Hilfe
Das Script macht halt nichts anderes, als auf's Menü zu klicken. Manches geht mit direkten Befehlen und manches halt nur so.
Jetzt bin ich schlauer, vielen dank und ein schönes Wochenende
Das stimmt! Es gibt auch noch eine Script für „detecting Sidecar“
Und wo finde ich das Script oder wie sieht das aus?
Do you have a solution for this toggle in Big Sur?
Sidecar toggle for Big Sur:
(change iPadName to Your iPad name)
set iPadName to "iPad"
tell application "System Events"
tell application process "ControlCenter"
repeat with tElement in menu bar items of menu bar 1
if (exists attribute "AXTitle" of tElement) then
if value of attribute "AXTitle" of tElement contains "Display" then
set theBar to tElement
tell theBar
click
end tell
set tElements to entire contents of window 1
repeat with i from 1 to count of tElements
set tElement to item i of tElements
if (title of tElement contains iPadName) then
tell tElement
click
end tell
exit repeat
end if
end repeat
tell theBar
click
end tell
exit repeat
end if
end if
end repeat
end tell
end tell
Edit: Loop optimized
Thank you so much! Working flawlessly again!
I can't seem to get it to work with the Big Sur update above. My iPad name is separated with spaces and used and ".
olo's 12" iPad.
Do I need to enter that a specific way to get this to work?
You can check the following:
Edit:
You can trial this:
set iPadName to "olo's 12\" iPad."
or leave default value to:
set iPadName to "iPad"
Thanks I changed my iPad name to make it easier without any special characters. Still doesn't work. For some reason even with the box checked to always show mirroring options the icon is not in the menu bar unless I go to settings and turn on the mirroring or Sidecar.
Try this:
Then the script must be work.
Guys, some major updates today. It's now language independent, and will select your iPad by default. No need to input your iPad name.
tell application "System Events"
tell process "ControlCenter"
try
perform action "AXPress" of menu bar item "Control Center" of menu bar 1
on error
display dialog "Please make sure you are using macOS Big Sur and have Control Center showing on your menu bar"
end try
try
tell checkbox 6 of group 1 of group 1 of window 1
perform action "AXPress"
end tell
delay 1
on error
display dialog "Cannot find Displays in your control center"
end try
try
tell checkbox 4 of group 1 of group 1 of window 1
perform action "AXPress"
end tell
on error
display dialog "Cannot find your ipad"
end try
end tell
end tell
For those are also using Alfred, this is my preset