• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Applescript count mail attachment error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Applescript count mail attachment error


  • Subject: Applescript count mail attachment error
  • From: Fred Diepeveen <email@hidden>
  • Date: Thu, 03 Mar 2016 15:51:04 +0100

Hi, I need some help.
I have a script processing mail with of without an attachment (jpg, png)
It worked well but now on Yosemite there is a problem:

Mail kreeg een fout: AppleEvent-handler mislukt. (Mail error: AppleEvent-handler failed)

Resultaat:

error "Mail kreeg een fout: AppleEvent-handler mislukt." number -10000

There is an attachment. The count gives an error. See underline

The script is like this

set walletmobileAccount to "demomycardwallet"

tell application "Mail"


set attachmentsFolder to "Volumes:Macintosh HD:Users:did4you:Downloads:" as rich text


set thereIsFoto to false
set fileCounter to 1
set logoFile to ""
set pictureFile to ""
-- display dialog "attachmentsFolder = " & attachmentsFolder
set theMessage to message 2 of mailbox "INBOX" of account walletmobileAccount



if (count of (theMessage's mail attachments)) > 0 then


repeat with theAttachments in theMessage's mail attachments
set originalName to name of the theAttachments
-- display dialog "Naam van attachment = " & originalName
set foto to originalName
if fileCounter = 1 then
set logoFile to originalName
end if
if fileCounter = 2 then
set pictureFile to originalName
end if
set savePath to attachmentsFolder & originalName
save theAttachments in savePath
do shell script "cp -f -R Users/did4you/Downloads/" & quoted form of originalName & " Users/did4you/Documents/MaakZP/Bijlagen/"
do shell script "rm -R Users/did4you/Downloads/" & quoted form of originalName
set fileCounter to fileCounter + 1


end repeat


-- display dialog "Foto : " & logoFile
-- display dialog "pictureFile : " & pictureFile
set thereIsFoto to true


end if -- are there any attachments
end tell


Mvgr.

Fred Diepeveen
email@hidden
+31 652002500




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Applescript count mail attachment error
      • From: Axel Luttgens <email@hidden>
    • Re: Applescript count mail attachment error
      • From: Brian Christmas <email@hidden>
  • Prev by Date: Re: How to tell Window Class/Type in Outlook 2011
  • Next by Date: AppleScript is now deliberately annoying me to death
  • Previous by thread: Re: How to tell Window Class/Type in Outlook 2011
  • Next by thread: Re: Applescript count mail attachment error
  • Index(es):
    • Date
    • Thread