To run this script you need to have GUI Scripting turned on...
Go to System Preference-->Universal Access
and 'tick' "Enable access for Assistive devices"
The scripts will not work without this !!!
There are two scripts below, one will turn off the Firewall, one will turn it on !
They have also been saved as AppleScript Applications so that you can leave them either in your Dock or on your Desktop...
Firewall On Script
tell application "System Preferences"
*****activate
*****set current pane to pane "com.apple.preferences.sharing"
end tell
delay 1
tell application "System Events"
*****tell process "System Preferences"
**********-- GUI Scripting statements:
**********try
***************click radio button "Firewall" of tab group 1 of window "Sharing"
**********end try
**********
**********delay 1
**********try
***************click button "Start" of tab group 1 of window "Sharing"
**********end try
**********
**********delay 1
**********
*****end tell
end tell
tell application "System Preferences" to quit
display dialog "Your Firewall is now on !" giving up after 2
---Ric @ www.mac-help.com
Firewall Off Script
tell application "System Preferences"
*****activate
*****set current pane to pane "com.apple.preferences.sharing"
end tell
delay 1
tell application "System Events"
*****tell process "System Preferences"
**********-- GUI Scripting statements:
**********try
***************click radio button "Firewall" of tab group 1 of window "Sharing"
**********end try
**********
**********delay 1
**********try
***************click button "Stop" of tab group 1 of window "Sharing"
**********end try
**********
**********delay 1
**********
*****end tell
end tell
tell application "System Preferences" to quit
display dialog "Your Firewall is now off !" giving up after 2
---Ric @ www.mac-help.com
regards
Ric
Go to System Preference-->Universal Access
and 'tick' "Enable access for Assistive devices"
The scripts will not work without this !!!
There are two scripts below, one will turn off the Firewall, one will turn it on !
They have also been saved as AppleScript Applications so that you can leave them either in your Dock or on your Desktop...
Firewall On Script
tell application "System Preferences"
*****activate
*****set current pane to pane "com.apple.preferences.sharing"
end tell
delay 1
tell application "System Events"
*****tell process "System Preferences"
**********-- GUI Scripting statements:
**********try
***************click radio button "Firewall" of tab group 1 of window "Sharing"
**********end try
**********
**********delay 1
**********try
***************click button "Start" of tab group 1 of window "Sharing"
**********end try
**********
**********delay 1
**********
*****end tell
end tell
tell application "System Preferences" to quit
display dialog "Your Firewall is now on !" giving up after 2
---Ric @ www.mac-help.com
Firewall Off Script
tell application "System Preferences"
*****activate
*****set current pane to pane "com.apple.preferences.sharing"
end tell
delay 1
tell application "System Events"
*****tell process "System Preferences"
**********-- GUI Scripting statements:
**********try
***************click radio button "Firewall" of tab group 1 of window "Sharing"
**********end try
**********
**********delay 1
**********try
***************click button "Stop" of tab group 1 of window "Sharing"
**********end try
**********
**********delay 1
**********
*****end tell
end tell
tell application "System Preferences" to quit
display dialog "Your Firewall is now off !" giving up after 2
---Ric @ www.mac-help.com
regards
Ric