Page 1 of 1

Applescript: make new contact group

Posted: Wed Feb 15, 2012 7:55 pm
by Beriechil
Dear Adium community,

I am currently trying to make a new contact group using Applescript. Does anyone have a working example code for that or can help me debug mine?

My non-working code:

Code: Select all

tell application "Adium" to tell account id 13 to make new contact group "test" with contacts {contact "contactName"}
Error: Can’t get contact group "test" of account id 13.

I also tried this:

Code: Select all

tell application "Adium" to make new contact group "test" with contacts {contact "contactName"}
which just gives me this error: Can’t make contact group "test" into type type.

---------------
More info, if needed / helpful:
I've found a working example code to create a new chat:

Code: Select all

tell application "Adium" to tell account id 13 to make new chat with contacts {contact "contactName"} with new chat window
So this proves the account id 13 and the contact "contactName" works for me. (The contact is not actually "contactName" but rather the contact's ID.)

Also, I found the account ID by using

Code: Select all

tell application "Adium" to get accounts

Re: Applescript: make new contact group

Posted: Wed Feb 15, 2012 10:09 pm
by Beriechil
After playing around with it, let me rephrase my question: Is it even possible to create a new contact group using Applescript?

Or, alternatively, to move a contact to a group. Either I'm doing it wrong or it doesn't work in 1.4:

Code: Select all

move contact "contactName" to contact group "groupName"