On drop

I’ve created in AS a droplet programma that when dropped a file mail opens,
create a new msg to selected persons and set the dropped file as a attachement.
But the mail opens the persons are selected but the attachement is not attachement.
Can anyone help me ?


on drop thefiles drag info dragInfo
	display dialog "Email file naar vrienden/kennissen ?" buttons {"Ja", "Nee"} default button "Ja"
	set antwoord to the button returned of the result	
	if the antwoord is "Ja" then
		tell application "Mail"
			set nieuwbericht to make new outgoing message with properties {subject:"Aan allen", content:return & return & "Groetjes." & return & return & return & "Automatisch gemaakt met Applescript en Automator!" & return & return & return}
			tell nieuwbericht
				make new to recipient at beginning of to recipients with properties {name:"Marc", address:"xxx@xxx.be"}
				set AppleScript's text item delimiters to ","
				set visible to true
				set sender to "xxx@xxx.com"
				make new attachment with properties {file name:thefiles}
			end tell
			activate
		end tell
	end if
end drop

And is it also possible to select the sendto out the adressbook ? Because now i put the names
in the script but if somenone change his adress then it does not work anymore.

Ik zou het zo doen (opslaan als Programma/Droplett)


on open DezeBestanden
	
	display dialog "Email file naar vrienden/kennissen ?" buttons {"Ja", "Nee"} default button "Ja"
	set antwoord to the button returned of the result
	
	if the antwoord is "Ja" then
		
		set Attach to added_items as alias
		set theName to "Marc"
		set theAddres to "xxx@xxx.be"
		set theSubject to "Aan allen"
		set theBody to return & return & "Groetjes." & return & return & return & "Automatisch gemaakt met Applescript en Automator!" & return & return & return
		
		tell application "Mail"
			set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
			tell newMessage
				set visible to true
				make new to recipient at end of to recipients with properties {name:theName, address:theAddres}
				tell content
					make new attachment with properties {file name:Attach} at after the last paragraph
				end tell
				activate
				send newMessage
			end tell
		end tell
		
	end if
	
end open

Jan Geerling

Sorry, but i’m working with ASS (studio).
Was not clear in other post.