Page 1 of 1

Adium Applescript help needed

Posted: Tue Sep 04, 2012 11:02 pm
by Dewdman42
I am trying to write an applescript that will go through all the 1000+ contacts that have accumulated, and delete the ones which are no longer active. I have maybe 100 active contacts. By active I mean, they are currently an "added" yahoo user on my yahoo contact list that I see. When I remove a contact, adium seems to keep the contact object internally anyway, just in case I might add that contact again, then their complete info will still be there. I want to completely nuke the ones that are not active anymore.

So the question is, in Applescript when I'm looking at a contact object, how can I determine if that contact is currently on my actual yahoo contact list, as opposed to just lurking in the plist?

Here is some code I have so far:

Code: Select all

tell application "Adium"
	repeat with eachAccount in every account of service "Yahoo!"
		set allContacts to get every contact of eachAccount
		repeat with eachContact in allContacts
			set dName to the display name of eachContact
			set uName to the name of eachContact
							
			if (exists contact uName) then
				set existsStatus to "TRUE"
			else
				set existsStatus to "FALSE"
			end if
			
			if (blocked of eachContact) then
				set blockedStatus to "TRUE"
			else
				set blockedStatus to "FALSE"
			end if
			
          --  NEEDED HERE HOW TO DETERMINE ACTIVE CONTACT
			
			-- Display a confirmation box for deleting the contact permanently
			set question to display dialog "User=" & dName & "    " & uName & " 
			Exists=" & existsStatus & " 
			Blocked=" & blockedStatus & " 
			Do you want to delete?" buttons {"Yes", "No"} default button 2
			set answer to button returned of question
			if answer is equal to "Yes" then
				-- delete it
			end if
			
		end repeat
	end repeat
	
end tell

Thanks in advance

Re: Adium Applescript help needed

Posted: Thu Sep 27, 2012 1:57 am
by Dewdman42
Does anyone have any idea about this?

Basically I ahve hundreds of contacts which in the past I added to Adium and later removed. For some reason Adium still has all those old "removed" contacts still on the internal list, even if they are not displayed anymore on the contact list gui (nor do they appear in yahoo messenger).

When using applescript and grabbing all the contacts for an account, its grabbing all of those old ones too that were removed a long time ago.

I'd love to remove them completely if possible, but barring that, how can we at least identify only the CURRENT contacts, the ones appearing in my actual contact list and still in yahoo messenger?

Re: Adium Applescript help needed

Posted: Sun Sep 30, 2012 11:52 am
by David Munch
I will ask you to send an email to the devl email list, as I think you'll get a much better response there!