Retweet script for Twitterrific

Simple AppleScript to make it easy to retweet from Twitterrific.

It uses GUI scripting to access the text input box in Twitterrific, so you need to activate this by enabling access from assistive devices in the Universal Access Preferences.

Enjoy


tell application "Twitterrific"
	set thisTweet to selection
	set thisText to post of thisTweet
	set thisUser to screen name of thisTweet
	
	activate
end tell
tell application "System Events"
	tell process "Twitterrific"
		tell group 1 of splitter group 1 of window 1
			set value of text field 1 to "Retweet: @" & thisUser & " " & thisText & " "
		end tell
	end tell
end tell

Display conversation from Twitter

2009-04-07: Updated query to search.twitter.com so that the result is more like what TwitterFon gives you when you drill down conversations.

I wrote a simple AppleScript to display the conversation history between two people in a tweet in Twitterrific.

I often want to focus on a conversation between two people in my timeline, without the distraction of all the other tweets. This AppleScript makes this as easy as selecting a tweet with an @reply, and running the AppleScript via the AppleScript menu.

All it does is, 1) get the user names of the sender and recipient of the tweet (only of @reply tweets), 2) query search.twitter.com for tweets sent from either of the user names.


tell application "Twitterrific"
	set thisTweet to selection
	set thisUser to screen name of thisTweet
	set thisPost to post of thisTweet
end tell

set thisOffset to offset of "@" in thisPost
if thisOffset is equal to 0 then
	display alert "No recipient in Tweet"
	return
else
	set thisOffset to thisOffset + 1
	set newUser to ""
	repeat until character thisOffset of thisPost is equal to " " or character thisOffset of thisPost is equal to ":"
		set thisCharacter to character thisOffset of thisPost
		set newUser to newUser & thisCharacter
		set thisOffset to thisOffset + 1
	end repeat
	
	open location "http://search.twitter.com/search?q=from%3A" & thisUser & "+to%3A" & newUser & "+OR+from%3A" & newUser & "+to%3A" & thisUser & "&lang=all"

end if