tell application "BrickHouse" activate end tell tell application "System Events" if UI elements enabled then tell process "BrickHouse" click button 4 of window "Quick Configuration: AllowOnlyPorts80and22" --unlock delay 2 click button "Activate" of tool bar 1 of window "Quick Configuration: AllowOnlyPorts80and22" delay 2 click menu item "Quit BrickHouse" of menu 1 of menu bar item "BrickHouse" of menu bar 1 end tell else tell application "System Preferences" activate set current pane to pane "com.apple.preference.universalaccess" display dialog "UI element scripting is not enabled. Check "Enable access for assistive devices"" end tell end if end tell