So my question is: is it possible, maybe via AppleScript or Shell, to activate this momentarily (so just for this particular macro) and deactivate it when the macro ends, without showing any warning?
I found this post:
Even though it indeed created the plist file, Safari still doesn't toggle that option ON
I don't know if this will work, but it's worth a try: Add a
killall cfprefsd command after the pref setting bit. That should force the prefs system to re-read all settings from your drive. However, you probably have to relaunch Safari, too … and even then, it may not work.
I was able to use an AppleScript to do this and then some KM actions to do some extra steps.
Now I got this script online:
tell application "System Events"
tell application "Safari" to activate
tell process "Safari"
-- check if developer menu is available
set menuItems to name of every menu bar item of menu bar 1
if "Develop" is not in menuItems then error "You must enable developer menu" number -1024
-- click to allow js events
-- confirm allow
I don't know if you are an AS expert or something, but I would like to use AS to add the password automatically without me relying on KM actions. Right now I have a Pause Until Found Image, followed by Insert Text by Typing, and then a Keystroke, running after the AS I shared above:
So is it possible to replace these 3 actions with something in the AS itself?
It would need something like:
1 - Pause until the next pop up is the password pop up
3 - Press OK (or Return/Enter key)
Given this is a security feature, and Apple clearly want you to have to enter your password before enabling this feature, it's likely to be difficult and fragile to automate.
I'm just gonna use the "manual" way then, as described above. Thanks.