Ausgewählten Text aus Safari als Email senden

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:
Code 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


This entry was posted in Apple Mail, Safari and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA:


− three = 1

Subscribe without commenting

  • Seite übersetzen:


    Paypal for Pizza:




  • Kategorien


  • Letzte Kommentare

    • Niklas: Vielen Vielen Dank! So klappt es!
    • hubi: Servus Niklas, ich habe mir den Quellcode noch einmal angesehen und habe nun unter 10.7.3 einen Weg gefunden...
    • Niklas: Klingt super das Script. Leider bekomm ich immer folgende Fehlermeldung: error “„Mail“ hat einen Fehler...
    • Jürgen: Hallo Hubi, beim Abfragen von Kennworten gibt es noch eine böse Falle: Das Format, in dem security antwortet,...
    • hubi: Am einfachsten Du öffnest im AppleScript-Editor mal das Funktionsverzeichnis (unter Ablage) von iTunes. Ein...