Saving mail to the desktop

I am looking for a script that will save an email to a folder on my desktop based on the subject title of the email.

Hi,

try this rule script, you have to change the name of the property theFolder,
the folder must already exist


property mailFolder : "~/Library/Mail"
property theFolder : "MailBackup"

using terms from application "Mail"
	on perform mail action with messages The_Messages
		set BackupFolder to quoted form of (POSIX path of (path to desktop) & theFolder)
		tell application "Mail"
			repeat with oneMessage in theMessages
				set theID to (id of oneMessage as Unicode text) & ".emlx"
				set messageLocation to do shell script "find " & mailFolder & " -name " & theID
				if messageLocation is not "" then do shell script "cp " & quoted form of messageLocation & " " & BackupFolder
			end repeat
		end tell
	end perform mail action with messages
end using terms from

sorry to sound newbieish,

I change theFolder to my choice of folder names, which I have to already have created on my desktop. so what part of the script decides what "keyword or object " in the subject line makes this rule apply or script work?

you have to define a rule in mail with your desired conditions and perform action “Run AppleScript”.
Then choose your script to attach