Safari Kiosk Tabs
02/02/09 09:03 Filed in: Watershed
An AppleScript to ensure that new Safari windows are opened in a tab
In the Watershed Café/Bar there are a number of ‘Slacker Tables’—public web browser kiosks set in glass tables. Oliver asked about a way to ensure that the instances of Safari running on the tables would open a new tab and not a new window. This is a simple AppleScript, to be saved as an Application and run, in a loop in the background.
This was only a quick, five minute hack but the results are surprisingly usable. Running the script as an application in the background doesn't appear to affect performance or stability over longer periods of time.
Note: this script has only been tested with Safari 3.2.1 in MacOS X 10.5.5
repeatdelay 1tell application "Safari"if the (count of documents) > 1 thenset theURL to the URL of the front documentif theURL is not "" thenclose front documenttell front window-- Safari appears to only let the front window create tabsset theTab to make new tabset current tab to theTabset the URL of theTab to theURLend tellend ifend ifend tellend repeat
|