コマンド ラインから Adium の連絡先メッセージを送信したいです。構文は次のようになりますecho test | im <contact>
。私はこのスクリプトを取得して、やりたいことを行うように変更しましたが、少し古いので、最新化しようとしています。これまでのところ、私はこれを機能させています(ここではapplescriptのみを変更しました。)
set stdinText to do shell script "echo \"\$MESSAGE\"" without altering line endings
tell application "Adium"
set user to get contact "$BUDDY"
if not (exists (chats whose contacts contains user)) then
if not (exists (first chat window)) then
tell account of user
set new_chat to make new chat with contacts {user} with new chat window
end tell
else
set existing_window to first chat window
tell account of user
set new_chat to make new chat with contacts {user} in window existing_window
end tell
end if
else
set new_chat to first chat whose contacts contains user
end if
send new_chat message stdinText
end tell
チャット メッセージが 2 回送信されることを除けば、うまく機能します。これは Adium のバグですか、それとも AppleScript で何か間違ったことをしていますか?