Hallo Uwe,
ja, das ist machbar. Im Script ist schon ein Test eingebaut, welcher feststellt, ob es sich um eine Datei
handelt. Diesen Test kann man mit 'else' ergänzen und einen entsprechenden Handler aufrufen:
---
property msgName : "Adressat"
property msgAddress : "<abc@def.de>"
property msgBody1 : "Datei"
property msgBody2 : "Ordner"
property msgSender : "Absender <abc@def.de>"
on adding folder items to thisFolder after receiving fileList
repeat with aFile in fileList
set filePath to (aFile as string)
if not (filePath ends with ":") then
set aName to name of (info for (file filePath))
sendFile(aName, aFile)
else
set aName to name of (info for (file filePath))
sendFile(aName)
end if
end repeat
end adding folder items to
on sendFile(msgSubject, msgAttachment)
tell application "Mail"
set newMessage to make new outgoing message with properties ¬
{subject:msgSubject, content:msgBody1 & return & return}
tell newMessage
set visible to true
set sender to msgSender
make new to recipient at end of to recipients with properties {name:msgName, address:msgAddress}
tell content
make new attachment with properties {file name:msgAttachment} at after the last paragraph
end tell
end tell
activate
save newMessage
send newMessage
end tell
end sendFile
on sendMessage(msgSubject)
tell application "Mail"
set newMessage to make new outgoing message with properties ¬
{subject:msgSubject, content:msgBody2 & return & return}
tell newMessage
set visible to true
set sender to msgSender
make new to recipient at end of to recipients with properties {name:msgName, address:msgAddress}
end tell
activate
save newMessage
send newMessage
end tell
end sendMessage
---
Es sollte funktionieren (habe es aber nicht getestet).
Im Moment wird – gleich wie bei der Datei – der Name des Ordners in das Betreff-Feld gesetzt.
Für die Meldung bei den Properties 'msgBody1' und 'msgBody2' die beiden Platzhalter ("Datei", "Ordner")
durch den gewünschten Text ersetzen.
Gruss, Hans
als Antwort auf: [#419433]