Created
May 13, 2014 19:44
-
-
Save neilvallon/e27bc2612d258567afde to your computer and use it in GitHub Desktop.
Applescript mail action to translate texts to piglatin and send them back - Jul 24 2009
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
using terms from application "Mail" | |
on perform mail action with messages theMessages | |
tell application "Mail" | |
repeat with theMessage in theMessages | |
set theText to content of theMessage | |
set theSender to sender of theMessage | |
set TempTID to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to space | |
set theText to text items of theText | |
set AppleScript's text item delimiters to "%20" | |
set theText to theText as string | |
set AppleScript's text item delimiters to TempTID | |
tell application "WebKit.app" | |
open location "http://piglatin.neilvallon.com/piglatin.php?msg=" & theText & "&sender=" & theSender | |
end tell | |
end repeat | |
end tell | |
end perform mail action with messages | |
end using terms from | |
tell application "Mail" | |
set myMessages to selection | |
tell me to perform mail action with messages myMessages | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment