mikelxc Posted August 3, 2020 Share Posted August 3, 2020 (edited) Use "sc" to enable and disable sidecar. KNOWN ISSUES: only supports English systems at this moment. And you have to turn on "show mirroring options in the menu bar" Download Link https://github.com/mikelxc/sidecar-alfredworkflow/releases/download/sc/Sidecar.alfredworkflow Edited August 3, 2020 by mikelxc Link to comment
Tony D Posted October 7, 2022 Share Posted October 7, 2022 Is there a version that works with MacOS Monterey? Link to comment
Tony D Posted October 7, 2022 Share Posted October 7, 2022 I found a script replacement that seems to work on Monterey 12.6 here: https://github.com/geofftaylor/connect-sidecar/issues/10#issuecomment-1188663732 Link to comment
TomBenz Posted October 7, 2022 Share Posted October 7, 2022 3 hours ago, Tony D said: I found a script replacement that seems to work on Monterey 12.6 here: https://github.com/geofftaylor/connect-sidecar/issues/10#issuecomment-1188663732 It doesn't work on Ventura. Anybody that can suggest a work around or script update? This is code where it is failing: tell application "System Settings" reveal pane id "com.apple.preference.displays" end tell Link to comment
kraig85 Posted October 10, 2022 Share Posted October 10, 2022 On 10/7/2022 at 10:03 AM, TomBenz said: It doesn't work on Ventura. Anybody that can suggest a work around or script update? This is code where it is failing: tell application "System Settings" reveal pane id "com.apple.preference.displays" end tell Have you tried... do shell script "open -b com.apple.systempreferences /System/Library/PreferencePanes/Displays.prefPane" ? Link to comment
TomBenz Posted October 10, 2022 Share Posted October 10, 2022 23 minutes ago, kraig85 said: Have you tried... do shell script "open -b com.apple.systempreferences /System/Library/PreferencePanes/Displays.prefPane" ? Thanks. This is working. How to integrate this with the overall code? The underlined line is giving error. do shell script "open -b com.apple.systempreferences /System/Library/PreferencePanes/Displays.prefPane" use AppleScript version "2.4" set iPadName to "iPad" -- TODO: Change to the name of your iPad tell application "System Events" tell process "System Preferences" delay 0.8 click window "Displays" tell pop up button "Add Display" of window "Displays" click delay 0.1 tell (last menu item of menu 1 whose name contains iPadName) click it end tell end tell end tell end tell tell application "System Settings" to close window 1 Link to comment
vitor Posted October 13, 2022 Share Posted October 13, 2022 @TomBenz System Settings (i.e. on Ventura) are quite broken and not as automatable (let’s hope that is a ”yet”). You’re asking for help on doing GUI automation on unfinished software, so whatever you do now may turn out to be wasted. Plus, most people are not on Ventura, so there are fewer who can help. That is the nature and disadvantage of installing betas. Link to comment
TomBenz Posted October 13, 2022 Share Posted October 13, 2022 1 hour ago, vitor said: @TomBenz System Settings (i.e. on Ventura) are quite broken and not as automatable (let’s hope that is a ”yet”). You’re asking for help on doing GUI automation on unfinished software, so whatever you do now may turn out to be wasted. Plus, most people are not on Ventura, so there are fewer who can help. That is the nature and disadvantage of installing betas. thanks @vitorI understand and can wait for the official release of Ventura. I installed Ventura after public beta 8/9 recently and it has been working well. Alfred is also working without problem. Just fyi. vitor 1 Link to comment
kraig85 Posted October 20, 2022 Share Posted October 20, 2022 On 10/10/2022 at 6:06 AM, TomBenz said: Thanks. This is working. How to integrate this with the overall code? The underlined line is giving error. do shell script "open -b com.apple.systempreferences /System/Library/PreferencePanes/Displays.prefPane" use AppleScript version "2.4" set iPadName to "iPad" -- TODO: Change to the name of your iPad tell application "System Events" tell process "System Preferences" delay 0.8 click window "Displays" tell pop up button "Add Display" of window "Displays" click delay 0.1 tell (last menu item of menu 1 whose name contains iPadName) click it end tell end tell end tell end tell tell application "System Settings" to close window 1 As a temp work around (and hoping Vitor is right with the 'yet' part), I've used this script by placing the screen mirroring icon in the menu bar and copying from automator's watch me do - bearing in mind that my script has British English spellings of centre etc.) -- Click the “Screen Mirroring” menu bar item. set timeoutSeconds to 2.0 set uiScript to "click menu bar item 6 of menu bar 1 of application process \"Control Centre\"" my doWithTimeout(uiScript, timeoutSeconds) -- Click the “<fill in title>” tickbox. set timeoutSeconds to 2.0 set uiScript to "click checkbox 3 of scroll area 1 of group 1 of window \"Control Centre\" of application process \"Control Centre\"" my doWithTimeout(uiScript, timeoutSeconds) on doWithTimeout(uiScript, timeoutSeconds) set endDate to (current date) + timeoutSeconds repeat try run script "tell application \"System Events\" " & uiScript & " end tell" exit repeat on error errorMessage if ((current date) > endDate) then error "Can not " & uiScript end if end try end repeat end doWithTimeout Link to comment
Tony D Posted October 26, 2022 Share Posted October 26, 2022 (edited) On 10/21/2022 at 6:23 AM, kraig85 said: Looks like the formatting got lost on your post Kraig. Edited October 26, 2022 by Tony D Link to comment
Tony D Posted November 3, 2022 Share Posted November 3, 2022 Did anyone get a script working in MacOS Ventura 13.0 yet? Link to comment
kraig85 Posted November 10, 2022 Share Posted November 10, 2022 On 11/3/2022 at 2:58 AM, Tony D said: Did anyone get a script working in MacOS Ventura 13.0 yet? ta-da!! do shell script "open -b com.apple.systempreferences /System/Library/PreferencePanes/Displays.prefPane" use AppleScript version "2.4" set iPadName to "iPad Pro" tell application "System Events" repeat until (exists window "Displays" of application process "System Settings") delay 0.1 end repeat tell process "System Settings" tell pop up button 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Displays" click delay 0.1 tell (last menu item of menu 1 whose name contains iPadName) click it end tell end tell end tell end tell tell application "System Settings" to quit Tony D and TomBenz 2 Link to comment
Tony D Posted November 11, 2022 Share Posted November 11, 2022 Thank you @kraig85 - works perfect and is fast! Link to comment
juch3059 Posted November 16, 2022 Share Posted November 16, 2022 Can somebody guide how to install this script in Alfred? Link to comment
kraig85 Posted November 16, 2022 Share Posted November 16, 2022 53 minutes ago, juch3059 said: Can somebody guide how to install this script in Alfred? I've created this workflow template for you (I think) - I've never actually used GitHub before (still a newbie) so fingers crossed it works. https://github.com/kraig85/myalfredworkflows Link to comment
peppy76 Posted December 13, 2022 Share Posted December 13, 2022 hi, is there a way to use this script to share the screen to an appletv? the appletv is named "Wohnzimmer"? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now