X

AppleScript for email program selection in Communicator

AppleScript for email program selection in Communicator

CNET staff
Previously, we linked to a MacFixIt Forums posting describing how to get Communicator to open up an alternate email program. David Converse sent us an AppleScript that does the job. While the script allows you to select a program to handle email, you could use a similar technique to register programs for telnet, ftp, and other protocols.

(Note: improper line wrapping may alter this script so it won't compile. I have inserted "-eol" as a comment at the end of each line. Make sure each "--eol" is at the end of the line in Script Editor before you compile it.)

Script originally written by David M. Converse, released into the public domain 6/23/99 --eol
tell application "Finder" --eol
copy (choose file with prompt "Choose an email program to work with Netscape:" of type "APPL") to FileSpec --eol
set CreatorSpec to the creator type of FileSpec --eol
set FileName to the name of FileSpec --eol
end tell --eol
if the button returned of (display dialog "Set " & (FileName as string) & " to be the email handler for Netscape?" buttons {"Cancel", "OK"} ¬ --eol
default button "OK" with icon 1) is "OK" then --eol
tell application "Netscape Communicatorú" --eol
register protocol (CreatorSpec as string) for protocol "mailto:" --eol
quit --eol
end tell --eol
end if --eol