2016-04-19 8 views
0

Ich habe versucht, ein AppleScript zu schreiben, um eine Nachricht weiterzuleiten und den Betreff zu bearbeiten. Momentan arbeite ich an der Weiterleitung und dem Auffüllen des Empfängers und der Betreffzeile.Bearbeiten Sie den Betreff einer weitergeleiteten Nachricht mit Applescript - bei der Bearbeitung der Betreffzeile ist ein Fehler aufgetreten.

Als ich dies ausführen es gibt mir den Fehler:

"Mail got an error: Can't set subject of item to any."

Hier ist der Code:

tell application "Mail" 
    set theSelection to selection 
    set theForwardedMessage to forward (item 1 of theSelection) with opening window 
    tell theForwardedMessage 
     make new to recipient with properties {address:"[email protected]"} 
     set subject to "blahblahblah" 
    end tell 
end tell 

ich kann nicht herausfinden, warum es mir erzählt es nicht bearbeiten können die Betreffzeile. Irgendwelche Zeiger?

Antwort

0

Ich hoffe, dass dies ein wenig helfen wird, aber ich verstehe Ihr Skript und Ihre Frage nicht vollständig.

set recipientName to "ZWEKKERBOY" 
set recipientAddress to "[email protected]" 
set theSubject to "Subject here" 
set theContent to "Content" 

--Mail Tell Block 
tell application "Mail" 

--Create the message 
set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true} 

    --Set a recipient 
tell theMessage 
     make new to recipient with properties {name:recipientName, address:recipientAddress} 

    --Send the Message 
    send 

end tell 
end tell 

- Kredit an Hersteller!

können Sie die

set theSubject to "Subject here" 

Linie

zu

ändern
set theSubject to subject 
-- that's "blahblahblah"