Created
December 7, 2013 01:49
-
-
Save matthewpalmer/7836328 to your computer and use it in GitHub Desktop.
Automatically post to tumblr from iA Writer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The file we are using is the frontmost one in iA Writer | |
# Returns the location of the file | |
set the_file to get file of front document of application "iA Writer" | |
# Get the contents of the file | |
set the_initial_text to (do shell script "cat " & quoted form of (POSIX path of the_file)) | |
# Set the title to the filename | |
set the_title to get name of front document of application "iA Writer" | |
# Append '!m' to the title so Tumblr knows it's Markdown | |
set the_markdown_title to the_title & " !m " | |
tell application "Mail" | |
# Create a new email | |
set theNewMessage to make new outgoing message with properties {subject:the_markdown_title, content:the_initial_text, visible:true} | |
tell theNewMessage | |
# Send the email to your private Tumblr posting email address | |
set tumblr_email to "YOUREMAILPUBLISHINGCODE@tumblr.com" | |
make new to recipient at end of to recipients with properties {address:tumblr_email} | |
# Make the send window the active window | |
activate | |
# Send the email (uncomment for the email to send without the preview screen) | |
# send | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment