• 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
Re: about your problem with attachments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about your problem with attachments


  • Subject: Re: about your problem with attachments
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 04 Jan 2017 22:27:35 +1100

Yvan, wouldn’t you also need something like ‘select message 1 of mailbox "messageStore"’? How else would you programatically select as a ‘selection’?

I’m surprised it worked though!

Regards

Santa


On 4 Jan 2017, at 10:11 pm, Yvan KOENIG <email@hidden> wrote:

Using the clipboard wasn't the logical scheme.

I was alerted by a question in macScripter about a code used in a rule doing the job for every systems before 10.12.2.
It fails with 10.12.2 and 10.12.3.
This is why I wrote the script using GUI scripting.
This morning I had the idea to re-run the script which failed on 2016/12/24.

What a surprise, this time it worked.
Here is the code:

set attachmentsFolder to (path to downloads folder) as text
tell application "Mail"
set selectedMessages to the selection

repeat with theMessage in selectedMessages
repeat with theAttachment in theMessage's mail attachments
set originalName to name of theAttachment
set savePath to attachmentsFolder & originalName
try
save theAttachment in file (savePath)
end try
end repeat
end repeat

end tell

Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France) mercredi 4 janvier 2017 12:11:18


Le 4 janv. 2017 à 11:48, Brian Christmas <email@hidden> a écrit :

Yvan, that’s interesting.

For the past 9 years I’ve been copying the attachments to the clipboard, then pasting them into a prepared job folder, inside a ’Temporary Printing’ folder. Has never had to worry about the Menus altering from version to version.

I think your method perhaps is more reliable, although as long as my running Mac is not used, the clipboard has proved highly reliable.

I repeat the copy and paste (with replacing), up to 4 times until the numbers copied & pasted match.

I later add each processed & barcoded image to that folder, (no matter what graphics program was used to barcode), along with a text edit sheet with a barcode indicating the saved date, and a list of attachments names, and sender details, that we call the ‘Cover Sheet’. The printed Cover Sheet follows the jobs through the factory floor, and each numbered job from an attachment is checked against the Cover Sheet barcode.

The whole folder is then moved, upon successful completion, to a daily dated folder, in a yearly folder. If a folder is left in the folder ‘Temporary Printing’, it means something went wrong with the process, and the desktop folder has a red Tag flag added.

Any yearly folders older than 2 years are deleted.

Regards

Santa


 _______________________________________________
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: about your problem with attachments
      • From: Yvan KOENIG <email@hidden>
References: 
 >Re: about your problem with attachments (From: Brian Christmas <email@hidden>)
 >Re: about your problem with attachments (From: Yvan KOENIG <email@hidden>)
 >Re: about your problem with attachments (From: Brian Christmas <email@hidden>)
 >Re: about your problem with attachments (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: about your problem with attachments
  • Next by Date: Re: about your problem with attachments
  • Previous by thread: Re: about your problem with attachments
  • Next by thread: Re: about your problem with attachments
  • Index(es):
    • Date
    • Thread