Applescript to save attachments in evernote, create link and copy into omnifocus

Hi there,

I have found an applescript on the net which basically creates a task in OF when a message is flagged in the mail.app, adds the message to OF and then unflags it. I am not an applescript genius but I managed to add some additional lines to it, so it also adds a predefined mailtag to it before it unflags it.

   property assignedKeywords : {"Action"}
 on run

tell application "Mail"
	repeat with _acct in imap accounts
		--Look For Flagged Messages in the INBOX
		set _acct_name to name of _acct
		set _inbox to _acct's mailbox "INBOX"
		
		set _msgs_to_capture to (a reference to ¬
			(every message of _inbox ¬
				whose flagged status is true))
		
		repeat with eachMessage in _msgs_to_capture
			set theStart to missing value
			set theDue to missing value
			set theOmniTask to missing value
			
			set theTitle to the subject of eachMessage
			set theNotes to the content of eachMessage
			
			set theCombinedBody to "message://%3c" & message id of eachMessage & "%3e" & return & return & theNotes
			
			tell application "OmniFocus"
				tell default document
					set newTaskProps to {name:theTitle}
					if theStart is not missing value then set newTaskProps to newTaskProps & {defer date:theStart}
					if theDue is not missing value then set newTaskProps to newTaskProps & {due date:theDue}
					if theCombinedBody is not missing value then set newTaskProps to newTaskProps & {note:theCombinedBody}
					
					set newTask to make new inbox task with properties newTaskProps
				end tell
			end tell
			
			using terms from application "MailTagsHelper"
				repeat with eachMessage in _msgs_to_capture
					set keywords of eachMessage to assignedKeywords
				end repeat
			end using terms from
			
			set flagged status of eachMessage to false
			
			
			
		end repeat
		
	end repeat
end tell

end run

I have also created two rules in mail.app and it works so far.

Actually I also want to pimp it with some extra functionality like if the message has an attachment create a note in evernote, copy the link and then add this link to the message in OF.

How can I combine these two scripts together?

Thanks in advance.
Karolin