13 мая 2008 г.

Экспорт списка контактов из Adium'а на AppleScript'е

Странная всё-таки штука этот AppleScript...

tell application "Adium"
set fileName to choose file name default name "AdiumContacts.txt"
set fileHandler to open for access fileName with write permission
try
set allContacts to every contact
repeat with oneContact in allContacts
write ?
"\"" & (title of account of oneContact as text) & "\", " & ?
"\"" & (title of oneContact as text) & "\", " & ?
"\"" & (display name of oneContact as text) & "\", " & ?
"
" to fileHandler
end repeat
on error errStr number errorNumber
close access fileHandler
error errStr number errorNumber
end try
close access fileHandler
end tell

Комментариев нет: