Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Applescript Controlling Firewall

Hi, I am making an applescript that turns on and off the firewall without asking for a password in system prefrences and also does it without pulling up windows, so it is stealth


Here is my code so far, right now it turns on and off the firewall but it requires a password and it pops up a window so its not stealth. I would like some help on this code, Thanks.


tell application "System Preferences"


activate


set current pane to pane "com.apple.preference.security"

end tell




tell application "System Events"

tell process "System Preferences"

click menu item "Security & Privacy" of menu "View" of menu bar 1


if title of button 4 of window 1 is "Click the lock to make changes." then

click button "Click the lock to make changes." of window 1


end if



try

click button "Turn On Firewall" of tab group 1 of window "Security & Privacy"

end try

set visible to false

end tell

end tell


tell application "System Preferences" to quit

Posted on Aug 1, 2013 2:10 PM

Reply

There are no replies.

Applescript Controlling Firewall

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.