All,
I am trying to modify the com.apple.Safari.plist to AllowJavaScriptFromAppleEvents -bool TRUE
and have been led to believe that the command below previously worked, prior to OS X El Capitan. To achieve this manually, one would do the following:
- Launch Safari, go Preferences>Advanced and check Show Develop menu in the menu bar.
- From the menu bar, go to Developer and check the Allow JavaScript from Apple Events.
- Authenticate with administrative credentials.
Since this isn't a great workflow to have users manually do this on their own, I'd like to automate this if possible. I'm not having much success with the short script below and was wondering if anyone has attempted to do this with more success running macOS Sierra 10.12 and Safari 10.
#!/bin/bash
defaults write ~/Library/Preferences/com.apple.Safari.plist AllowJavaScriptFromAppleEvents -bool TRUE
exit 0
The above command seemingly works (i.e. no errors and running a defaults read
command shows that the AllowJavaScriptFromAppleEvents
is set to TRUE
or with a value of 1
) but the Safari settings do not indicate that these were modified as they were with the manual process shown first. Keep in mind that this will largely be applied to macOS devices that are already deployed with users having already customized their own Safari settings so packaging a DMG with Composer with FEU and/or FUT enabled isn't a viable option. Thoughts?