Creating a new tab in an existing window
Posted: Tue Oct 11, 2011 9:15 pm
Hello,
I am trying to start a new chat with a contact and add this chat as a tab in an already existing chat window. When doing so, I get the following error:
Creating a new tab returns the error above. I have no problem creating a new chat window when no one exist already.
Does anyone have an idea what I am doing wrong?
Best regards,
Simon B. Støvring
I am trying to start a new chat with a contact and add this chat as a tab in an already existing chat window. When doing so, I get the following error:
This is the code I am using. First I retrieve all chat windows where the ID is not "-1" (I don't know why these might show up. Probably closed chat windows?). Then I check if there are any chat windows, if there are, I want to start a new chat in one of these. If there are no existing chat windows, then I create a new.Can't create chat in that chat window.
Code: Select all
set myChatWindows to every chat window where id is not "-1"
if length of myChatWindows > 0 then
# Create new tab
tell (account of firstContact) to make new chat with contacts {firstContact} at (item 1 of myChatWindows)
else
# Start new chat with account of first contact
tell (account of firstContact) to make new chat with contacts {firstContact} with new chat window
end ifDoes anyone have an idea what I am doing wrong?
Best regards,
Simon B. Støvring