Please see below an AppleScript example:

Example Script

Web Confidential Home Page