property Myrecipient : "" property mysubject : "" property EmailBody : "" on run tell application "Finder" set sel to (get selection) end tell new_mail(sel) end run on open droppedFiles new_mail(droppedFiles) end open on new_mail(theFiles) tell application "Mail" set newMessage to make new outgoing message with properties {visible:true, subject:mysubject, content:EmailBody} tell newMessage make new to recipient with properties {address:Myrecipient} tell content repeat with oneFile in theFiles make new attachment with properties {file name:oneFile as alias} at after the last paragraph end repeat end tell end tell activate end tell end new_mail
tell application "Finder" activate open folder "" of folder "" of folder "" of folder "Users" of startup disk end tell
tell application "Mail" using terms from application "Mail" set selectedMails to selection set theMessage to first item of selectedMails set theBody to "message:%3C" & message id of theMessage & "%3E" set theSubject to the subject of theMessage & " (From " & the sender of theMessage & ")" tell application "Reminders" set theList to list "Inbox" set newToDo to make new reminder with properties {name:theSubject, body:theBody, container:theList} end tell end using terms from end tell
tell application "Mail" set maillist to selection repeat with i from 1 to number of items in maillist set this_item to item i of maillist if class of this_item is message then set background color of this_item to red -- other colors are -- gray / green / orange / red end if end repeat end tell
>tell application "Finder" set sel to the selection as text set the clipboard to POSIX path of sel end tell
Source: https://habr.com/ru/post/157003/
All Articles