Automating Skype's 'This message has been removed'
One of the stranger features of Skype is that that it allows you to delete the contents of a message that you’ve already sent to someone - something I haven’t seen on any other messaging system I’ve used.
For example if I wrote a message in Skype and wanted to edit it I would press the 'up' arrow:
Once I’ve deleted the message I’d see this in the space where the message used to be:
I almost certainly am too obsessed with this but I find it quite amusing when I see people posting and retracting messages so I wanted to see if it could be automated.
Automator allows you to execute Applescript so we wrote the following code which selects the current chat in Skype, writes a message and then deletes it one character at a time:
on run {input, parameters}
tell application "Skype"
activate
end tell
tell application "System Events"
set message to "now you see me, now you don't"
keystroke message
keystroke return
keystroke (ASCII character 30) --up arrow
repeat length of message times
keystroke (ASCII character 8) --backspace
end repeat
keystroke return
end tell
return input
end run
We wired up the Applescript via the Utilities > Run Applescript menu option in Automator:
We can then go further and wire that up to a keyboard shortcut if we want by saving the workflow as a service in Automator but for my messing around purposes clicking the 'Run' button from Automator didn’t seem too much of a hardship!
About the author
I'm currently working on short form content at ClickHouse. I publish short 5 minute videos showing how to solve data problems on YouTube @LearnDataWithMark. I previously worked on graph analytics at Neo4j, where I also co-authored the O'Reilly Graph Algorithms Book with Amy Hodler.