Created
January 11, 2015 07:34
-
-
Save pdxmph/68d950605a73eea0c59a to your computer and use it in GitHub Desktop.
Send a message to Trello
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
on log_err(message) | |
display notification message | |
log message | |
end log_err | |
on run | |
try | |
tell application "Mail" | |
set theAddress to "my_trello_board_address@trelllo.com" | |
set messageURL to "" | |
set messageContent to "" | |
set theSelection to selection | |
set theMessage to item 1 of theSelection | |
set messageURL to ("message://%3c" & theMessage's message id & "%3e") | |
set messageText to (content of theMessage) | |
set messageSubject to subject of theMessage | |
set myMessage to make new outgoing message with properties {content:messageURL & return & return & messageText, subject:messageSubject, visible:true} | |
tell myMessage to make new to recipient with properties {address:theAddress} | |
-- I'd like to delete the message, but it seems to cause a 10s freeze in the app | |
-- delete theMessage | |
end tell | |
on error errmsg | |
my log_err("Could not send message: " & errmsg) | |
end try | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment