if ((get system attribute "sysv") < 4160) then -- 4160 = 0x1040 is Sytem version 10.4.0 (Tiger) display dialog "This script needs MacOS X version 10.4 or higher" buttons {"OK"} default button 1 return end if set mailPlist to ((path to preferences folder from user domain as Unicode text) & "com.apple.mail.plist") tell application "System Events" activate repeat with eachAccount in property list items of property list item "MailAccounts" of contents of property list file mailPlist if (get value of property list item "AccountType" of eachAccount) = "iToolsAccount" then exit repeat end repeat if (get value of property list item "AccountType" of eachAccount) is not "iToolsAccount" then display dialog "No .Mac Account defined." buttons {"OK"} default button 1 return end if try set theAliasDescriptions to (get value of property list item "EmailAliases" of eachAccount) on error display dialog "No .Mac aliases found in Mail's preferences." buttons {"OK"} default button 1 return end try repeat with eachAlias in theAliasDescriptions set |name| of eachAlias to text returned of (display dialog "Please enter name to be used for the .Mac alias corresponding to the address " & |alias| of eachAlias default answer |name| of eachAlias) end repeat set value of property list item "EmailAliases" of eachAccount to theAliasDescriptions if process "Mail" exists then display dialog "No need to restart Mail for the changes to take effect." buttons {"OK"} default button 1 end tell