Ausgewählten Text aus Safari als Email senden
19/09/2009 Mit cmd+i kann man ja in Safari die Website als HTML-Email verschicken. Mit dem Skript wird eine Email des ausgewählten Textes erstellt und an eine neue Email eingetragen:
No CommentsCode zum markieren einmal anklicken
tell application "Safari"
tell document 1
set selected_text to do JavaScript "var txt = '';
if (window.getSelection)
{
txt = window.getSelection();
}
else if (document.getSelection)
{
txt = document.getSelection();
}
else if (document.selection)
{
txt = document.selection.createRange().text;
}
else return;
"
set siteURL to URL
end tell
end tell
tell application "Mail"
activate
make new outgoing message with properties {visible:true, subject:"Something Interesting", content:"" & siteURL & return & return & selected_text}
end tell