Jump to content
arjunrc

Workflow to send emails to multiple people (including CC) in your contact book

Recommended Posts

Okay, so you have a valid address book, your Mac OS version is the same as mine, but for some reason my workflow is not able to read your address book. (I use iCloud too). The only thing I can imagine is that there is some format difference between your address book and mine that I am not aware of. Unfortunately, the only way I can help is if I get a copy of your address book so I can see if I can read it myself (AddressBook-v22.abcddb) otherwise we may keep trying things to no avail. I totally understand you may not want to share that as it has all your personal contact details. I can't think of how else to solve the problem though :-(

Share this post


Link to post

Okay, so you have a valid address book, your Mac OS version is the same as mine, but for some reason my workflow is not able to read your address book. (I use iCloud too). The only thing I can imagine is that there is some format difference between your address book and mine that I am not aware of. Unfortunately, the only way I can help is if I get a copy of your address book so I can see if I can read it myself (AddressBook-v22.abcddb) otherwise we may keep trying things to no avail. I totally understand you may not want to share that as it has all your personal contact details. I can't think of how else to solve the problem though :-(

Sure I can send you that.

 

How do you want to do it. And you’ll have to tell me exactly what file/s it is you want me to send. Or do you just want me to send you a file>export>contacts archive.

Share this post


Link to post

Just send me the file ~/Library/Application\ Support/AddressBook/AddressBook-v22.abcddb 

 

NOTE: Please remember, by doing this, you are sending me a copy of all your contacts in your address book, so I will have access to their names/emails and any other details you may have stored in it. I can promise you I won't use it for any other purposes besides trying to figure out why my workflow is not able to read it, but if it makes you uncomfortable, please don't send it (and its perfectly reasonable to be uncomfortable)

 

If you are ok despite the warning above, please email that file to me - I'll send you my email ID in a private message. DO NOT post a link to that file in this forum

Edited by arjunrc

Share this post


Link to post

Kerry, I think I know the problem. Do you store any contacts locally in your address book or are they only in iCloud? Open your contacts app, and select 'On My Mac' - do you see any contacts? If you don't see any contacts, then this workflow cannot access them. When I dumped your address book, it was all empty

Edited by arjunrc

Share this post


Link to post

Yeah I was wondering about that as the change to iCloud affected a whole pile of developers so they’ve all moved to iCloud.

 

No there’s nothing in Contacts called On My Mac. There’s only a header called iCloud followed by all by groups under that. 

 

That’s just the way it set up when I converted to iCloud I have no idea when.

 

I did notice though in the metadata folder the file called .info (need tinkertools as this is hidden) changed its time to reflect the time I deleted the contact.

 

This might be useful but the cloud thing - I don’t know where it comes to the Workflow.

 

http://apple.stackexchange.com/questions/18497/where-does-mac-os-x-store-contacts-in-my-address-book

Share this post


Link to post

Hmm, well, lets try this last way:

Open up your contacts app. Then do a file->export to Contacts Archive. It creates a ".abbu" directory, right click, and select "show package contents" -   and look for the file AddressBook-v22.abcddb . If its the same size as the one you sent me, then I'm out of ideas on how to solve this issue :-) (The metadata directory, apparently is for spotlight). If its much larger, then great - I can post a solution for you to use the exported version.

Edited by arjunrc

Share this post


Link to post

Yes. I saved it to the desktop though as you can save this anywhere you want. It created the file Contacts - 2013-04-29.abbu. I’m sure this is a fully local file with all my contacts in it for backup and archival purposes. That is, if you wanted to clean up you DB but have a backup of it before you did this is what you’d create. This file, as I said can be stored anywhere and named anything except for the extension. So I could store it in applications support. If your script can reach into this file then all it would be a matter of is if people were to use the script they’d have to first create an archival file and put it in a specific location for the purposes of the script and name it to support the script. That wouldn’t be difficult. Do you want this file sent to you.

Share this post


Link to post

Unfortunately, this file's address book is the same as the other one. The abbu ZIP looks bigger because it has all the metadata files in it.

 

So this is not going to work with you. I had a last (I should stop saying last) thought: Alfred itself offers the 'email' keyword - have you used it? Is that able to read your icloud address book? I am not using address book APIs instead short-circuiting to the DB. If Alfred's email keyword can access your address book, I'll investigate that route instead.

Edited by arjunrc

Share this post


Link to post

Yes, I’ve used it and it brings up an Alfred representation of Peter’s contact info. He has two email addresses so you can just choose the one you want to send the email to and it creates a new email with his email address that you chose in it.

Share this post


Link to post

At this point I just start typing the others addresses as they’ll quickly popup in Mails dialogue. I have a a couple of groups for people that I send to all the time.

Share this post


Link to post

Okay thanks. I'm going to go to sleep now :-) I'll tinker around tomorrow to see what it takes to do it the right way (i.e. using Apple contact book APIs). 

Share this post


Link to post

Okay thanks. I'm going to go to sleep now :-) I'll tinker around tomorrow to see what it takes to do it the right way (i.e. using Apple contact book APIs). 

 

That makes sense. Its a long night. I’m just writing an article while we’re doing this.

 

So have a good sleep.

Share this post


Link to post

Okay, lets try and solve this. If this script works for you, then I will update my workflow to use this instead.

 

1. Download this ZIP file (here, then click File->Download on the menu) - its called foo.zip

2. Extract the contents to your Desktop (2 files, foo.sh and foo.scpt)

3. Launch a terminal

4. Type in

cd ~/Desktop

5. Type in

sh ./foo.sh peter

 

Let me know if its lists all the peters and their emails.

Edited by arjunrc

Share this post


Link to post

Nope. Foo.scpt is on the desktop as foo.sh

 

I ran the following and got an error message

 

 

Last login: Mon Apr 29 20:18:49 on ttys000
Kerrys-iMac:~ kerrysdawson$ CD ~/desktop
Kerrys-iMac:~ kerrysdawson$ sh ./foo.sh peter
sh: ./foo.sh: No such file or directory
Kerrys-iMac:~ kerrysdawson$ 

Share this post


Link to post

Sorry it was Spell Catcher that capitalized it.

 

It worked

 

 

 
Kerrys-iMac:desktop kerrysdawson$ 
 
Now what's next.
Edited by kerrydawson

Share this post


Link to post

Ok great. I'll release an updated workflow soon.

 

In the mean time, please confirm this:

 

1. Start a terminal

2. Type in 

open "mailto:foo@peace.org"

 3. confirm that this opens up your default email client ready to send a mail to "foo@peace.org"

 

(If you don't see the email client up on your screen, just click on your mail client to see if did it)

 

If it did not work, try step 2 onw more time:-)

Share this post


Link to post

Excellent :-) Now go back to the first email in this thread - I've released version 1.3 of the workflow - let me know if it works

Make sure you delete the old workflow first (I don't know how Alfred handles multiple versions installed)

Edited by arjunrc

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...