2017-10-30 37 views
-2

Mac OSX 10.12.6에서 작업 중이며 AppleScript를 작성하여 전자 메일을 만든 다음 PDF와 jpeg 파일을 첨부하십시오. 스크립트를 실행할 때 pdf 및 jpeg 파일을 첨부 할 때 오류가 발생합니다.Mail for AppleScript로 작업하기위한 첨부 파일 받기

메일에 오류가 발생했습니다. {filename : "MacintoshHD : 사용자 : peteradam : PPAttachments : EmailFolder : Quote_15018_301017.pdf", 파일 크기 : 200339}를 첨부 파일의 유형 속성으로 만들 수 없습니다.

파일 이름이 변경된 jpeg에 대해 오류 메시지가 반복됩니다.

또한 Signature와 theAttachment1을 별칭으로 설정하여 사용해 보았습니다.

다음 스크립트는대로 님의 "[email protected]"

세트에서 Subject에 "Expoprint"

설정 theContent

세트 TheRecipient에 "이름"

설정 theAddress을 "의심스러운 경우"로 설정하지 마십시오.

보낸 사람을 "나"로 설정하십시오.

"사용자 : MacintoshHD peteradam : PPAttachments을 : EmailFolder을 : ExpoPrint Signature.jpg를"3210

TELL 응용 프로그램 "파인더"theSignature로 설정에게 전하고 응용 프로그램 "파인더"을 "MacintoshHD theAttachment1을 설정

설정 theSignatureSize

20530에 : 사용자 : peteradam : PPAttachments : EmailFolder : Quote_15018_301017.pdf 메일 "

set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent & return & return, visible:true} 

tell theMessage 

    set sender to theSender 

    make new to recipient at end of every to recipient with properties {name:TheRecipient, address:theAddress} 

    try 

     make new attachment with properties {file name:theAttachment1, file size:theAttachmentSize1} at after last paragraph 

     set message_Attachment to 0 

    on error errmess 

     log errmess 

     display dialog errmess 

     set message_Attachment to 1 

    end try 

    log "message_attachment =" & message_Attachment 

    make new attachment with properties {file name:theSignature, file size:theSignatureSize} at after last paragraph 

    delay 1 

end tell 
"

세트 theAttachmentSize1

TELL 응용 프로그램 200339에 " 17,451,515,

최종 파일 크기 속성을 제거하여 I 문제가 해결

답변

0

에게