Mac Help Forums


Reply
Thread Tools Display Modes

How to turn off your Firewall with AppleScript !

 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      7th February 2006
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
Attached Files
File Type: zip Firewall Scripts.zip (43.0 KB, 226 views)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AppleScript Language Guide for AppleScript 2.0 Patrick Stadelmann AppleScript 0 12th March 2008 05:00 PM
Is it gone or did I turn it off? Ruddell Mac 20 29th December 2007 04:54 AM
G4 Won't Turn On Diversion Mac Desktops 6 26th September 2007 02:27 AM
How To Call AppleScript Within AppleScript Jim Hines AppleScript 0 7th July 2007 04:18 AM
Delay between Applescript end and Applescript App Closing Lucanus AppleScript 2 14th September 2003 11:38 PM


All times are GMT +1. The time now is 08:02 PM.
Mac-Help.com is an independent website and is not affiliated with Apple Inc.


Welcome!
Welcome to the Mac Help Forums
 


Latest Threads
Unable to log in to websites
AMonty20 (2 Hours Ago, 05:52 PM)

Add Different Speech Commands
bae_22 (3 Hours Ago, 04:40 PM)

Login (2 macs) passwords spontaniously changed?
Roger Vaught (4 Hours Ago, 03:31 PM)

Best car charger or inverter for Macbook Pro?
imeme87 (4 Hours Ago, 03:22 PM)

New book about Steve Jobs << take part in it!
Arjan (10 Hours Ago, 09:37 AM)

 


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51