Deleting INBOX.msf for Netscape Email

Hey All,

I’ve got ths script below to trash the INBOX.msf file for a Netscape email user. It’s set to a specific user only at this point. I’d like to be able to use the script on any users mac, but I can’t figure out how to set the following:

  1. User directory (the user directory can either be the mac user’s name or default).
  2. The .slt directory (which is different on every user account).

Any help would be greatly appreciaited.

Here’s the script as written for a single user:


------------------------------------------------------
-- trash1969.scpt
-- august 01, 2006
-- version 1.0 beta
------------------------------------------------------
set myHome to path to home folder as string
set mailSpool to (myHome & "Library:Mozilla:Profiles:user name here:x9qnghco.slt:ImapMail:mail.pbpost.com") as string

tell application "System Events"
	if application process "mozilla-bin" exists then
		tell application "Netscape"
			quit
		end tell
	end if
end tell

tell application "Finder"
	try
		delete (files of folder mailSpool whose name contains "INBOX.msf")
	end try
end tell

display dialog "1969 messages should be deleted.  Click Restart Netscape to continue." buttons {"Restart Netscape", "Cancel"} default button 1 with icon 2

tell application "Netscape"
	activate
end tell

I don’t have Netscape installed to check really this out, but I would say…

In regards to #1 you could some checks to see if default exists or if you know what the username is check for its existence… look in this recent thread for some ideas how.

As for #2 you could loop through the items of the user folder and look at the the last three characters of each item for “.slt” -4 through -1 or by using grep.