Link to home
Create AccountLog in
Avatar of speechrec
speechrecFlag for Switzerland

asked on

Problems with a list in AppleScript (selecting from a list of email adresses


I want to make a list of email-adresses I frequently use in AppleScript, select one of them to create an email to the selected Address.

I've gotten pretty far, but I get this error message in the Script Editor.
Fehler in der AppleEvent-Routine." number -10000

What's wrong with my code?

tell application "Mail"
	set myList to {"", "", ""}
	choose from list myList
	set theMessage to make new outgoing message with properties {visible:true}
	tell theMessage
		make new to recipient at end of to recipients with properties {address:myList}
	end tell
end tell

Open in new window

Avatar of t-max
Flag of Israel image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of speechrec


set toAddress to (choose from list myList) as string

Open in new window

Thank you very much, works like a charm! That will teach me to declare my variables…