Adium + Apple Script help needed

An instant messenger which can connect to AIM, GTalk, Jabber, ICQ, and more.
Dominus
Muffin
Posts: 27
Joined: Wed Sep 30, 2009 9:43 am

Adium + Apple Script help needed

Postby Dominus » Sat Jun 23, 2012 8:27 am

Hi all,
since the handling of Adium with flaky connections is somewhat irritating, or better worded no easy scripting available to quickly autochange nick to the default and getting rid of the old connection via nickserv ghost/release, I wrote two scripts to do that for me.

For freenode that recently added "nickserv regain":

Code: Select all

tell application "Adium"
   send the chat "#some irc room I'm always in" message "/msg nickserv regain nickname password"
end tell


and for another server that doesn't have the regain feature

Code: Select all

tell application "Adium"
   send the chat "#some irc room I'm always in" message "/msg nickserv release nickname password"
   send the chat "#some irc room I'm always in" message "/nick nickname"
   send the chat "#some irc room I'm always in" message "/msg nickserv identify password"
end tell


To keep the nickserv chats down to a minimum and avoid the "you can't REGAIN yourself" (or so) "you are already logged in" "You cannot RELEASE yourself" messages I need help to fine tune the scripts.

Is there a way to check what nick one has? Or what nicks are in a chat? I need to find out whether Dominus, Dominus1 or Dominus2 are present (and only then execute the regain, release, etc, but that I know how to do). I couldn't find that in the Apple Script description page on Adium

Dominus
Muffin
Posts: 27
Joined: Wed Sep 30, 2009 9:43 am

Re: Adium + Apple Script help needed

Postby Dominus » Sat Jun 23, 2012 9:03 pm

ok, got it somewhat. with

Code: Select all

tell application "Adium" to display name of account of the service "IRC"

I can get going.
Unfortunately there is a bug with using "account "accountname"" when it is an irc account. Somehow the accountname isn't accepted, presumably because adium appends the nickname to the account and things get confused.

It would be nice if there were some place to get further help with scripting adium...

Dominus
Muffin
Posts: 27
Joined: Wed Sep 30, 2009 9:43 am

Re: Adium + Apple Script help needed

Postby Dominus » Sat Jun 23, 2012 9:44 pm

Ok, I got a working script that *should* run everytime I connect.
I found out that IRC accounts are named after the Nickname you enter in the account preferences. So if you are using the same nick on more than one server this gets confusing with the accountname that I'd like to use. I solved this by giving one network a different nickname and change it right away to my default nick.
The script looks like this

Code: Select all

set realnick to "MyNickname"
tell application "Adium"
   set server1 to display name of account "accountname" of the service "IRC"
   set server2 to display name of account "accountname" of the service "IRC"
   if not server1 is equal to realnick then
      send the chat "#some room you are always on" message "/msg nickserv identify MyNickname password"
      send the chat "#some room you are always on" message "/msg nickserv regain MyNickname"
   end if
   if not server1 is equal to realnick then
      send the chat "#some room you are always on" message "/msg nickserv release MyNickname password"
      send the chat "#some room you are always on" message "/nick MyNickname"
      send the chat "#some room you are always on" message "/msg nickserv identify password"
   end if
end tell

If the accountname thing is annoying you can also replace

Code: Select all

set server1 to display name of account "accountname" of the service "IRC"
   set server2 to display name of account "accountname" of the service "IRC"

with

Code: Select all

set server1 to display name of first account of the service "IRC"
   set server2 to display name of second account of the service "IRC"
Last edited by Dominus on Mon Jun 25, 2012 8:39 am, edited 1 time in total.

Dominus
Muffin
Posts: 27
Joined: Wed Sep 30, 2009 9:43 am

Re: Adium + Apple Script help needed

Postby Dominus » Mon Jun 25, 2012 8:02 am

hmm, this is not really working the trigger of "you connect" seems to not run this script every time...

Anyone down with apple script and adium? Or how to contact someone who is?

jhon17066
Harmless
Posts: 1
Joined: Wed Feb 25, 2015 7:28 am

Re: Adium + Apple Script help needed

Postby jhon17066 » Wed Feb 25, 2015 7:47 am

Apple will going to buy samsung soon :lol: :lol: :lol: :lol:


Return to “Adium”

Who is online

Users browsing this forum: Google [Bot]