Solved

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

Posted on 2011-02-13
2
1,188 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:speechrec
2 Comments
 
LVL 6

Accepted Solution

by:
t-max earned 500 total points
ID: 34884236
tell application "Mail"
	set myList to {"email1@gmx.net", "email2@gmail.com", "email3@hotmail.com"}
	set toAddress to (choose from list myList) as string
	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:toAddress}
	end tell
end tell

Open in new window

You need to save the value chosen from the list in a variable, as a string.
Then you just simply use it in the address property.
Good luck!
0
 

Author Comment

by:speechrec
ID: 34884256
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…
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Deploystudio is a system which can be used to deploy OSX clients and servers within the small/medium or large business environments. The system is built onto of the OSX Server NetBoot system and uses images & workflows as its core assets. While work…
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now