modified from cc licensed ( BY NC SA ) flickr photo by Jacob Whittaker: http://flickr.com/photos/jacobwhittaker/2902947614/
modified from cc licensed ( BY NC SA ) flickr photo by Jacob Whittaker: http://flickr.com/photos/jacobwhittaker/2902947614/

note: if you have updated to the Mavericks version of OSX the app will not work. Thank Apple for restricting the amount of Apple Script capability… see Chris Long’s efforts. Our best recommendation is use Keynote ’09 if you want to auto tweet

If you create presentations in Apple’s Keynote, here is the ticket to add some twitter punch to your presentations- a script that can automatically send out tweets when you change slides. Your audience will wonder how you managed to tweet so much while presenting. Practice your humble smile.

I first wrote up the method of how to do this back in February 2011 — since then twitter has changed their authorization scheme, plus the retirement of the AP1 1.0 broke the original app written by Toby Harris. It was actually just a minor edit needed in the applescript, but leave it to a dog to figure it out.

Here quickly are some more modern steps for setting it up. It looks a tad geeky, and you will have to enter the world of command line. If this scares you, take two Powerpoints and don’t call me in the morning. This was recently written up an screencast by John Greenwood, so you could easily follow his steps too (see below for his video).

First, the under the hood stuff, you are going to install into your OS a little but of code called twurl, which is a command line interface that sends out commands to twitter (see the twurl readme for some more handy things you can do with it). To do this, you need to find and open a Terminal window (it is an application usually inside your Utilities folder). From the command line, enter

sudo gem i twurl "“source http://rubygems.org

a command to install twurl (you will ahem need to be connected to the internet). Use of sudo requires you to enter your login password, it allows you to do anything to your system.

You next have to go to (and log in with your twitter credentials) to the developer site https://dev.twitter.com/apps/new.

Here you will create a new “app” which really means, you are just going to set up something so twurl on your computer can communicate to twitter through your account.

Creating a keynote twitter app.
Creating a keynote twitter app.

The information here does not matter much since no one really sees it, but create a name like Jenny’s Keynote Tweet Machine, use your blog URL or some URL. Guess wildly at the captcha, and create the application.

You are not done. One more setting.

Click the Settings tab and change Application type to Read and Write. And then click Update.

app type

That is all the information twitter needs fro you, but you need two key pieces of information fro twitter.

Click on the Details tab, and copy the two cryptic looking mumbo jumbo strings for Consumer key and Consumer secret (no screenshot here since… some of this is secret). I like to toss them in a text file. I then will contruct in this text file (or you can do this in terminal if you are a deft copy paster)

twurl authorize "“consumer-key CONSUMERKEYMUMBOJUMBO "“consumer-secret SECRETKEYJUMBOMUMBO

This does need to be exact, make sure you do not have any weird extra characters in the keys. Now go to your Terminal app, and paste that entire command string and press Return/Enter.

Terminal will respond with a really long super duper mumbo jumbo URL- copy it exactly, and paste in your web browser. This will bring up the Twitter authorization screen. which you really should approve (otherwise, why are you even doing this?). It will return to you a pin number, which you know copy, paste back into Terminal, and press RETURN/Enter.

That is the magic connection. It is a good idea to do a command line test first to make sure twurl is operational. In Terminal, type:

twurl -d 'status=Making sure twurl works because @cogdog told me to do this' /1.1/statuses/update.json

This is telling twurl to create a tweet for you. Note the location of the quotes, they are important here!

If this does not work, and you have previously set up twurl before, you may have conflicting apps- see the twurl documentation for Changing Your Default Profile.

By now you should be ready to try some keynote tweeting. First use the View options in keynote o make visible the speaker notes. For each slide you want a tweet to go out, wrap the text of the tweet int [twitter]…..[/twitter] tags. URLs ought to be shortened, but I suggest you test the length of the tweet, and allow for any prefacing of hashtags.

And you do not have to send a tweet for every slide, it can look a bit offensive on twitter to be firing off like a kid with their first fireworks.

You should next download the revised Keynote Tweet 2.5 app (see my post on the mods needed to be changed in AppleScript to get it to work). And admire the new icon made for it by John Greenwood.

Launch the Keynote Tweet application. It gives a little bit of explanation, and then offers a field where you can insert a hash tag or other string you want to be sent with each tweet. Put your Keynote in presentation mode, and tweet away (be sure to quit the Keynote Tweet application when you are done just to make sure you do not inadvertently send out more tweets).

If you prefer to learn from a video, check out a new screen cast tutorial by John Greenwood

And there you go, Tweet and Toot away!

Update Nov 17, 2014
Thomas Brady shared the script modifications he says is working in the latest Keynote in Yosemite OS. I cannot modify the script until I upgrade (Mavericks Applescript is not liking it). You will have to launch AppleScript, then open Keynote AutoTweet, and replace the scripts with what is below. Then you can compile it to save.

If anyone can test this, and let us know it works, it gives hope for those who wish to present and tweet together.

display dialog ¬
	"I will tweet anything between [twitter][/twitter] tags in your notes while you're presenting. Use the menu to quit this script when you're finished." with title ¬
	"Keynote Tweet" with icon caution ¬
	buttons {"Begin"} ¬
	default button "Begin"


on idle
	
	tell application "System Events"
		set okflag to (exists (some process whose name is "Keynote"))
	end tell
	
	if okflag then
		
		
		tell application "Keynote"
			if playing is true then
				set slideNotes to get presenter notes of current slide of first document
				
				if slideNotes is not equal to "" then
					
					set leftCoord to offset of "[twitter]" in slideNotes
					set rightCoord to offset of "[/twitter]" in slideNotes
					if leftCoord is greater than 0 and rightCoord is greater than 0 then
						set tweet to get characters (leftCoord + 7) thru (rightCoord - 1) of slideNotes as string
						if tweet is not equal to "" and tweet is not equal to "][" then
							if extras is not equal to "" then set tweet to tweet & " " & extras
							if tweet is not equal to lastTweet then
								-- display dialog tweet buttons "Okay" default button "Okay"
								do shell script "/usr/bin/t update \"" & tweet & "\""
								set lastTweet to tweet
							end if
						end if
					end if
				end if
			end if
			return 1
		end tell
	end if
end idle

UPDATE Nov 18, 2014: Again, since I cannot test this, I am thinking a portion of Thomas’s script is specific to the setup on his machine where it calls the shell script. Borrowing from the older script, I am trying to guess if this will work:

if tweet is not equal to lastTweet then
	set twitter_status to quoted form of ("status=" & tweet)
	do shell script "twurl -d " & twitter_status & " /1.1/statuses/update.json"
	set lastTweet to tweet
end if

The post "Geeking The Keynote Tweet App (again) (updated instructions)" was originally pulled like taffy through a needle's eye at CogDogBlog (http://cogdogblog.com/2013/09/geeking-the-keynote-tweet-app-again-updated-instructions/) on September 21, 2013.

29 Comments

Leave a Comment

All fields are required. Your email address will not be published.