[Adium-devl] Use of Applescript make commands
Evan Schoenberg
evan at adiumx.com
Fri May 23 11:16:17 UTC 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20080523/16970250/attachment-0001.html>
More information about the devel
mailing list