0
applescript의 전자 메일에 첨부 파일을 여러 개 추가하려고합니다. 제목을 폴더와 주 번호로 설정합니다. Apple Mail 응용 프로그램, 여러 첨부 파일 추가
set {b, c} to {"1/1/1000", 364876}
set {year:yy, month:mm, day:dd} to (current date)
set yy to text 3 thru 4 of (yy as text)
set d to ((((current date) - (date b)) div days + c) div 7) + 1
set e to ((((date ("1/1/" & (year of the (current date)) as string)) - (date b)) div days + c) div 7) + 1
set weekCode to (yy & (d - e) as text)
set rSpace to "
"
set theSubject to "folder Week " & (text 3 thru 4 of weekCode)
tell application "Finder"
\t set folderPath to folder ((get (path to home folder) as Unicode text) & "Documents:folder" as Unicode text)
\t set thefList to ""
\t set fcount to 1
\t repeat
\t \t try
\t \t \t set theFile to ((file fcount) in folderPath as alias)
\t \t \t set theFile to name of theFile
\t \t \t if thefList is "" then
\t \t \t \t set thefList to theFile
\t \t \t else
\t \t \t \t set thefList to thefList & "
" & theFile
\t \t \t end if
\t \t \t set fcount to (fcount + 1)
\t \t on error
\t \t \t set fcount to (fcount - 1)
\t \t \t exit repeat
\t \t end try
\t end repeat
\t
\t --return thefList
\t set theAttachment to theFile
end tell
repeat (fcount - 1) times
\t set rSpace to "
" & rSpace
end repeat
tell application "Mail"
\t activate
\t set theMessage to make new outgoing message with properties {visible:true, sender:"[email protected]", subject:theSubject, content:rSpace}
\t
\t
\t tell theMessage
\t \t make new to recipient with properties {address:"[email protected]"}
\t \t set acount to 1
\t \t repeat fcount times
\t \t \t
\t \t \t try
\t \t \t \t make new attachment with properties {file name:(paragraph acount of thefList)} at after the last word of the paragraph acount
\t \t \t \t set message_attachment to 0
\t \t \t on error errmess -- oops
\t \t \t \t log errmess -- log the error
\t \t \t \t set message_attachment to 1
\t \t \t end try
\t \t \t log "message_attachment = " & acount
\t \t \t set acount to (acount + 1)
\t \t end repeat
\t \t
\t \t send
\t end tell
end tell
프로그램을 수정하여 첨부 파일을 추가하려면 어떻게해야합니까?
대단히 감사합니다! –