Hello, This is my 1st post here. I have an issue in 10.15.7 that I can not fix. Screen sharing and file sharing work as expected, once they are turned on. Although, after a boot, or a restart these are both unchecked. I'm at a lost to how to fix, so I wrote a KM script to turn on Screen and File Sharing at login.
It's a simple script, but will only run one time after building it and will not run a second time. Curious what I am missing? I open "Sharing" that works all the time. Then, this is were it stops ... I need to hit "tab" 3 times to get to Screen share, then "space" to toggle it on, then, the down arrow, then "space" to turn on File sharing. I can easily do this pattern with my keyboard, but KM gets caught on something? Many thanks for any thoughts. Best, Brad
System Preferences.app can be a tricky beast to automate. It can usually be done with AppleScript, but the language is very finicky. I don't know exactly how to do that, although others here might.
Another Way?
I have a couple of ideas that might fix the underlying issues without using Keyboard Maestro.
Have you tried using "Remote Management" instead of screen sharing:
When KM is “typing” keystrokes it often does it faster than MacOS can keep up with so often the solution to this kind of issue is to insert some Pause actions to give your Mac an opportunity to catch up, so to speak.
It would be really helpful if you could upload your macro (both as a file and an image) so we can properly see what’s going on and also test it for ourselves. That way removes a lot of the guesswork!
Thanks tjluoma, I did try Remote Management and it will also turn off on a reboot, or start.
I can manually turn these functions on, but, these are for headless cpus, which makes it all more cumbersome. BTW: All testing has been on cpus with monitors. I've been working on this for a few days, I did try the sudo command, both manually and with KM, but then found out "yesterday" that sharing can not be enabled from the terminal 10.14 on... at least that was the prompt I got. Odd that I never got that message at the beginning for these commands.
tiffle, Thanks I did try different pauses, not nothing worked. Once I upload, this will the basic script with no pauses. At this point I hope I just missed something and can move on
Hi Brad - since macros could be malicious, you'll find people here are more comfortable to download your macro once they've seen it here on the forum, which is why I suggested posting it as both an image and a file.
Just so you know - if you have any coding experience you'll see that the only difference is the use of row 1 and row 2 in the new version as opposed to row 2 and row 3 respectively in the previous version.
Here's my Preference Pane where I've highlighted the settings of interest:
So if you want to tweak stuff, you have a head start!
Exactly, thanks for that, my "sharing pane" does look like the one in tjluoma's post. I will be able to test in the next hour. And good info on the the script, it does make sense to me. Brad
Thank you Tadeusz, This script works every time! You have allowed me to move on from this impasse, thanks for that. It would be hard for me to work without screen-share functionality. My hunch is that it was botched on the last 10.15.7 "security update" but of course not certain. Have a great weekend, and many thanks. Best, Brad
Thank you to all the folks who helped @cradbobb - Brad had emailed me late last week but I was busy volunteering at a robotic competition and had just enough time to suggest the forum might help before I could get another look at the problem.
Thank you all for proving once again that this really is the best forum on the Internet!