|
|
Somebody: write this plug-in for Address Book?
|
|
|
|
Professional Poster
Join Date: Jul 2001
Location: New York, NY
Status:
Offline
|
|
Can somebody write an Address Book plugin to automatically address letters & envelopes?
(like the reverse-telephone directory plugin released today on versiontracker)
It'd just take the Name and address of the "me" card and of the selected card and create a letter or envelope in TextEdit, based on template stored in app support or documents or something.
I've tried doing this with applescript, but I've run into a snag in that Applescript has no font control, at least in TextEdit.
Anyway, I think it'd be very useful and popular...
PS - If those with more know-how tell me this is something a newbie could learn to do with a few free weeks, I'll try it after the bar exam this summer...
|
cpac
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jun 1999
Location: Las Vegas, NV, USA
Status:
Offline
|
|
It's already been done... iDress.
Chris
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Jul 2001
Location: New York, NY
Status:
Offline
|
|
not really what I had in mind - iDress is it's own app, and it's overkill (especially since in 10.3 we can print nice labels from the address book directly)
What I was looking for was more along the lines of an Address Book plugin (not a separate app) so that I'm looking at a contact in address book, I click on the address and in the menu where it currently gives me options to "Map of" "Copy mailing label" or "Copy URL of Map" there'd be another option to "compose letter in TextEdit"
Selecting that option would then create a new TextEdit document based on a template you can modify (perhaps just another TextEdit document, stored someplace in the Library, with specifically coded Tags for where the info should be inserted), addressed to that person at that particular address.
Does that make sense?
|
cpac
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
Here's something to get you started - I've basically just splatted two different scripts off the web together:
I still don't really understand TextEdit's Scripting - - it seems very unreliable and rigid - but the script seems to work:
-- Put this script into your "Address Book Plugins" folder in your ~/Library folder.
[php]
using terms from application "Address Book"
on action property
return "address"
end action property
on action title for p with e
set theName to (first name of p) & " " & (last name of p)
return "Address letter to " & theName & " (2)"
end action title
on should enable action for p with e
return true
end should enable action
on perform action for p with e
set theAddress to (first name of p) & " " & (last name of p) & return & (street of e) & return & (city of e) & space & (state of e) & space & (zip of e)
set myAddr to address 1 of my card
set returnAddress to (first name of my card) & " " & (last name of my card) & return & (street of myAddr) & return & (city of myAddr) & space & (state of myAddr) & space & (zip of myAddr)
makeEnvelope(returnAddress, theAddress)
end perform action
end using terms from
on makeEnvelope(fromAddress, toAddress)
tell application "TextEdit"
activate
make new document at the beginning of documents
tell front window
set name to "Letter to blah"
end tell
set the text of the front document to (toAddress)
tell the text of the front document
set font to "Baskerville"
set size to 36
end tell
end tell
end makeEnvelope
[/php]
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2001
Location: Cambridge UK
Status:
Offline
|
|
If you have Stone Create, the developer provides a script to do exactly what you're after.
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
Originally posted by Krypton:
If you have Stone Create, the developer provides a script to do exactly what you're after.
Yes, that's one of the scripts I ruthlessly slaughtered to make the above script.
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Jul 2001
Location: New York, NY
Status:
Offline
|
|
Hey thanks Diggory!
Now I've just got to play around with it.
[edit: figured out my initial problems]
(
Last edited by cpac; Apr 14, 2004 at 10:24 AM.
)
|
cpac
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Jul 2001
Location: New York, NY
Status:
Offline
|
|
Ok - I've made quite a bit of progress, but have a couple scripty questions for y'all out there:
(1) Is there any way to tell text to take a particular alignment (i.e. center align?)
(2) In the above example script there's code that sets the name of the front window to something specified (I've tinkered with it so that now it sets the name to something useful like "2004-4-15 Ltr to John Smith" but when I go in TextEdit to "Save" it defaults to "Untitled 10" or whatever. Can I force the window title to be the default save-as title?
TIA!
|
cpac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|