[Adium-devl] Use of Applescript make commands
Matt Handley
applmak at gmail.com
Fri May 23 14:26:43 UTC 2008
Oh, you're quite close. The correct 1.3svn syntax is:
tell application "Adium"
tell account "applmak"
set c to make new contact with properties {name:"123456789"}
end tell
end tell
I don't think making a reference to am undefined contact should (or
could) add that contact. However, I think I can change things so that
contact names, rather than references, can be used. So the following
would become syntactically correct:
make new chat with contacts {"123456789"} with new chat window
I think that should appease scripters.
Matt
On May 23, 2008, at 6:16 AM, Evan Schoenberg wrote:
> http://trac.adiumx.com/ticket/9879 points out that the address book
> scripts are broken with the new applescript implementation.
>
> The SMS one has an obvious initial problem - screenName was copied
> from another script and should actually be phoneNumber.
>
> However, fixing this to
>
> tell first account of service "AIM"
> make new chat with contacts {contact phoneNumber} with new chat
> window
> end tell
>
> only works if a contact with the UID phoneNumber on the first
> account already exists. Otherwise, we get a nil contact and
> everything goes poorly. Could looking up a contact by UID be made
> to create the contact if it doesn't exist?
>
> Furthermore, I tried to make a new contact, but I can't figure out
> the syntax. The following:
>
> tell first account of service "AIM"
> set myContact to make new contact with properties
> {UID:phoneNumber}
> make new chat with contacts {myContact} with new chat window
> end tell
> gives:
> 2008-05-23 07:09:35.403 Adium[35494:10b] Error converting apple
> event to script command: -1700
> 2008-05-23 07:09:35.404 Adium[35494:10b] Original event:
> <NSAppleEventDescriptor: 'core'\'crel'{ 'kocl':'Ccnt', 'prdt':
> { 'usrf':[ "uid", 'utxt'("+12412445469") ] }, &'subj':'obj
> '{ 'form':'indx', 'want':'Cact', 'seld':1, 'from':'obj
> '{ 'form':'name', 'want':'Csrv', 'seld':'utxt'("AIM"),
> 'from':'null'() } }, &'csig':65536 }>
> 2008-05-23 07:09:35.405 Adium[35494:10b] Offending object
> descriptor: <NSAppleEventDescriptor: { 'usrf':[ "uid",
> 'utxt'("+12412445469") ] }>
> 2008-05-23 07:09:35.406 Adium[35494:10b] Expected type
> descriptor: <NSAppleEventDescriptor: 'obj '{ 'from':'Ccnt',
> 'form':'prop', 'seld':'pALL', 'want':'prop' }>
>
>
> Help! :)
>
> Cheers,
> Evan
> _______________________________________________
> Adium-devl mailing list
> Adium-devl at adiumx.com
> http://adiumx.com/mailman/listinfo/adium-devl_adiumx.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20080523/79cdb9f8/attachment-0001.html>
More information about the devel
mailing list