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

Hi

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?

Thanks!
tell application "Mail"
	set myList to {"email1@gmx.net", "email2@gmail.com", "email3@hotmail.com"}
	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

ASKER CERTIFIED SOLUTION
Avatar of t-max
t-max
Flag of Israel image

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

ASKER

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…