Tom Talks Microsoft Teams and Microsoft 365 news and opinions

Clear All Twitter Favourites with AutoHotkey

image

It’s that time of year where I declare bankruptcy on my Instapaper, email review folder and Feedly. Another way I store “interesting things I should read someday” is twitter favourites. Unfortunately twitter don’t provide a way to bulk clear / delete all twitter favourites. I had accumulated

My first thought was to look into using PowerShell to pull and modify the information somehow. I’m sure its possible, but not trivial due to the way twitter authenticates apps.

A kind development team have produced an app called unfavinator,  http://unfavinator.com/ that can sign into your account and bulk unfavourite. I’m sure it’s completely legit, but giving 3rd party apps that kind of access makes me nervous. So I turned to Autohotkey. Autohotkey allows you to automate the mouse and keyboard in windows.

 

Fortunately Twitter has keyboard shortcuts for Favourite/Un-favourite, and Chrome can be controlled with keyboard shortcuts too. So with a simple loop script I can;

  • Put my mouse in a position where it will click on the favourite tweet to open it
  • Wait for the page to load then send “F” key to unfavourite it
  • use alt and left key to send Chrome back a page to the favourites list
  • Loop and click the next favourite

; Delete all twitter favourites in Chrome

Loop {

Sleep, 3000  ;  second

; Click mouse
MouseClick, left,

Sleep, 3000  ;  second

Send, f

Sleep, 3000  ; 1 second

Send {Alt Down}
Send {Left}
Send {Alt Up}

 

} ; close loop

 

Simple and a little time consuming, but I left it running and it got the job done. A couple of times I had to re-align the mouse. You may need to pay with the sleep timers depending on your page load time.

Here is a quick video of the script running:

About the author

Tom Arbuthnot

A Microsoft MVP and Microsoft Certified Master, Tom Arbuthnot is Founder and Principal at Empowering.Cloud as well as a Solutions Director at Pure IP.

Tom stays up to date with industry developments and shares news and his opinions on his Tomtalks.blog, UC Today Microsoft Teams Podcast and email list. He is a regular speaker at events around the world.

Add comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Tom Talks Microsoft Teams and Microsoft 365 news and opinions