Skip to content

Instantly share code, notes, and snippets.

@chinghanho
Created June 17, 2013 03:37
Show Gist options
  • Save chinghanho/5794508 to your computer and use it in GitHub Desktop.
Save chinghanho/5794508 to your computer and use it in GitHub Desktop.
In Chrome, tweet with selected text which contained the title and the URL of the page from Tweetbot app.
on run (input)
tell application "Google Chrome"
set theURL to URL of active tab of first window
set theTitle to title of active tab of first window
set theData to theTitle & " " & theURL & " #「" & input & "」" as string
end tell
activate application "Tweetbot"
tell application "System Events" to tell process "Tweetbot"
click menu item "New Tweet" of menu 1 of menu bar item "Tweet" of menu bar 1
set value of text area 1 of scroll area 1 of window 1 to (theData as text)
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment