• Apfeltalk ändert einen Teil seiner Allgemeinen Geschäftsbedingungen (AGB), das Löschen von Useraccounts betreffend.
    Näheres könnt Ihr hier nachlesen: AGB-Änderung
  • Was gibt es Schöneres als den Mai draußen in der Natur mit allen Sinnen zu genießen? Lasst uns teilhaben an Euren Erlebnissen und macht mit beim Thema des Monats Da blüht uns was! ---> Klick

AppleScript - Empfänger aus Zwischenablage einfügen

  • Ersteller Mitglied 59480
  • Erstellt am

Mitglied 59480

Gast
Hi,

ich brauche für die Arbeit ein AppleScript, welches eine neue Email generiert mit der Besonderheit, dass der Empfänger der Email immer unterschiedlich ist. Ich möchte quasi, dass ein kopierter Text (die Emailadresse des Empfängers) aus der Zwischenablage in das "An" Feld bei AppleMail kopiert wird. So weit verständlich?

Ich habe im Grunde das wichtigste Schript schon vorliegen:

Neue Email mit Betreff und Empfänger:
Code:
tell application "Mail"
    set newMessage to make new outgoing message with properties {subject:"Der Betreff", content:"" & return & return}
    tell newMessage
        set visible to true
        make new to recipient at end of to recipients with properties {address:"die adresse..."}
    end tell
    activate
end tell

Jemand eine Idee?
 

sedna

Galloway Pepping
Registriert
22.10.08
Beiträge
1.359
Hallo,

set dest to the clipboard
tell ...
{address:dest}


Gruß
 

Mitglied 59480

Gast
Hi,

danke für die Antwort. Ich habe das ganze in der Zwischenzeit selber lösen können, wenn auch etwas umfangreicher:

Code:
set thetext to the text returned of (display dialog "Gib deine Emailadresse ein…" default answer "")
set the clipboard to thetext

tell application "Mail"
    
    set newMessage to make new outgoing message with properties {subject:"Backup", content:"" & return & return}
    tell newMessage
        set visible to true
    end tell
    activate
    tell application "System Events"
        keystroke "v" using {command down}
    end tell
    
end tell
 

Pill

Adams Parmäne
Registriert
07.07.12
Beiträge
1.310
So geht's richtig:

Code:
[B]set[/B] [COLOR=#4F8F00]thetext[/COLOR] [B]to[/B] [B]the[/B] [COLOR=#5730BE]text returned[/COLOR] [B]of[/B] ([COLOR=#012FBE][B]display dialog[/B][/COLOR] "Gib deine Emailadresse ein…" [COLOR=#012FBE]default answer[/COLOR] "")
[B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Mail"
[COLOR=#0433FF][COLOR=#000000]    [B]set[/B] [/COLOR][COLOR=#4f8f00]theMessage[/COLOR][COLOR=#000000] [B]to [/B] [/COLOR][B]make new[/B] [I]outgoing message [/I]with properties[COLOR=#000000] {[/COLOR][COLOR=#812fdc]visible[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#812fdc][I]true[/I][/COLOR][COLOR=#000000], [/COLOR][COLOR=#812fdc]subject[/COLOR][COLOR=#000000]:"Backup"}[/COLOR][/COLOR]
[COLOR=#4F8F00][COLOR=#000000]    [B]tell[/B] [/COLOR]theMessage[/COLOR]
[COLOR=#0433FF][COLOR=#000000]        [/COLOR][B]make [/B]new [I]to recipient [/I]at[COLOR=#000000] [B]end[/B] [B]of[/B] [/COLOR][I]to recipients [/I]with properties[COLOR=#000000] {[/COLOR][COLOR=#812fdc]address[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#4f8f00]thetext[/COLOR][COLOR=#000000]}[/COLOR][/COLOR]
    [B]end[/B] [B]tell[/B]
[B]end[/B] [B]tell[/B]