AppleScript Internet Automation in Mac OS 9
In Mac OS 9, AppleScript served as a powerful bridge between desktop workflows and the burgeoning World Wide Web by utilizing AppleEvents for inter-application communication. Through scriptable web browsers like Internet Explorer and Netscape Communicator, system-level networking controls, and third-party Scripting Additions (OSAX), users could automate browsing tasks, manage dial-up connections, and even power dynamic web servers directly from classic Macintosh systems.
Browser Automation and the Spyglass AppleEvents
Web browsers during the Mac OS 9 era exposed their features to AppleScript via dictionary suites. Most major browsers, including Netscape Navigator/Communicator and Microsoft Internet Explorer for Mac, adhered to the standard Spyglass AppleEvent protocol along with their own proprietary dictionaries.
Through standard tell application blocks, scripters
could:
- Open specific URLs using the
OpenURLcommand. - Automate window behaviors, such as reloading pages, navigating browsing histories, and toggling kiosk modes.
- Retrieve the current page's HTML source code or active URL into a variable for parsing.
- Save rendered pages or trigger file downloads to the local hard drive.
Connection Management and Internet Config
Mac OS 9 relied heavily on modular networking components, which AppleScript could manipulate to establish and terminate connections.
Through the scriptable Remote Access application, scripts could programmatically dial phone numbers using a standard 56k modem, verify connection status, execute internet-dependent tasks, and hang up immediately to conserve dial-up minutes.
Additionally, AppleScript interacted with Internet Config, a centralized Mac OS database that stored default client preferences, helper applications, and proxy settings. Scripters used AppleScript to query or modify user agents, download folders, and default email or web applications on the fly.
Direct Networking via Scripting Additions (OSAX)
Because native AppleScript lacked built-in low-level TCP/IP socket support, developers used Scripting Additions (OSAX) to add raw networking capabilities.
Popular extensions like TCP/IP Scripting Addition, Jon's Commands, and Akua Sweets allowed AppleScript to:
- Open raw network sockets directly to remote hosts and ports without launching a web browser.
- Issue manual HTTP
GETandPOSTrequests. - Communicate with remote FTP, POP3, and SMTP servers.
- Resolve DNS hostnames and ping IP addresses to test network availability.
Server-Side Automation and AppleScript CGIs
AppleScript was not merely a client-side tool in Mac OS 9; it was frequently deployed as a server-side language for web hosting. Using Mac-based web servers such as StarNine’s WebSTAR or MacHTTP, developers wrote Common Gateway Interface (CGI) scripts entirely in AppleScript.
Incoming web requests were passed by the server to compiled
AppleScripts (often saved as .acgi or Asynchronous CGI
files). The script parsed URL parameters or form data, interacted with
scriptable desktop applications such as FileMaker Pro to retrieve
records, dynamically generated an HTML response string, and returned the
payload back through the web server to the remote client.