Mailsmith
Other Programs
Scripts
Mailsmith.scpt
Archive to sub-mailbox
Check Spelling
Find reply
Change font size
Submit Script to JEM
Fix common spelling errors
Setting SMTP server
URL from Safari
Address from AB
linkMunge
Export to Address Book
Saving attachments
Digest Script
File with same
POP window position
Position of new windows
iCal and Mailsmith
Edit From Line
Modified Thread Script
Reply to Selection
Temporary Text Window
Compact gain
Tracking backups
Edit subject
Googler
Auto-rewrap
MMA
SMTP server
Open, fetch, and close
URL Manager
BrainForest
Thread by Author
Thread by subject
Export Email
Get Selection
Read Addresses
Export Email
Organize Email
Account setup
Mailsmith 2 BBEdit
BBEdit 2 Mailsmith
Search II
Check One
Delete Enclosure
Open, fetch, close
Set Answered
Set Redirected
Empty Trash
List found
Print Several
Del. old. msg.
Delete Enclosures
Accounts
Address Book
Editing
Filters
General
Import/Export
Links
Mailboxes
Memory
Scripting
Speed
send/receive
Tips/Tricks


Getting Address from Address Book

Author Christian Smith
Last modified 2003-02-21
What is this?

please forgive a little shameless begging here ;-)

I'd like to be able to add contact info from one of my Apple Address Book entries to a message in Mailsmith. it appears to be possible, looking at the AB applescript dictionary. does anyone have such an applescript that might be useful as a starting point?

Well, there doesn't seem to be anyway to access the "current" entry in the Address Book, so you can't be looking at an entry and run a script which inserts data from that entry into Mailsmith.

If you know the id of the entry you want you can use the script below. This will insert some of the data from a specific person into the current message window.


tell application "Address Book"
	set my_text to ""
	set p_prop to properties of person 1
	set p_addr to properties of address 1 of person 1
	set my_text to name of p_prop
	set my_text to my_text & return & organization of p_prop
	set my_text to my_text & return & street of p_addr
	set my_text to my_text & return & city of p_addr & ", " & state of p_addr & " " & zip of p_addr
end tell

tell application "Mailsmith"
	set selection of message window 1 to my_text
end tell