Run program on email with multiple attachments

The Exchange service EEAttachments can save your attachments or mails automatically to your file-system and process it by your own scripts.
Post Reply
pol5446
Posts: 1
Joined: Wed Apr 03, 2013 4:09 pm

Run program on email with multiple attachments

Post by pol5446 »

Hi,

I would like to save all attachments of an email into a folder named after the subject of the email.
Currently I'm working on a batch file to process all attachments and move them in the appropriate folder. I just started writing it and it has to be developed more to rule out some exceptions that could happen (eg. signs in the subject that can't be used in a folder name, ... ), but it's a start.

Code: Select all

@ECHO OFF

SET EXTRACTDIR=D:\Fotos-Attachments\Extracted

IF EXIST %EXTRACTDIR%\%2 GOTO MOVEFILE
MKDIR %EXTRACTDIR%\%2

:MOVEFILE
MOVE %1 %EXTRACTDIR%\%2\

:END
This works fine for single-attachment emails and the first attachment that is extracted from the email, but all following attachments won't process.
The log-file says some properties aren't ready yet to be used. I suppose this error refers to the arguments configured in EEAttachments, which are the standard "%file% %subject% %from%"

Code: Select all

I:2013-04-03T17:06:36 (EEAttachments.exe)=>(SyncJob) processing: D:\Fotos-Attachments\move_in_folder.bat "D:\Fotos-Attachments\Extracted\20130306_153623.jpg" "002107-13" "ict@xxx.xxx" 
I:2013-04-03T17:06:36 (EEAttachments.exe)=>(SyncJob) Filecontent is equal: D:\Fotos-Attachments\Extracted\20130306_153709.jpg 
E:2013-04-03T17:06:36 (EEAttachments.exe)=>(SyncJob) batch processing You must load or assign this property before you can read its value. 
I:2013-04-03T17:06:37 (EEAttachments.exe)=>(SyncJob) Filecontent is equal: D:\Fotos-Attachments\Extracted\20130306_164344.jpg 
E:2013-04-03T17:06:37 (EEAttachments.exe)=>(SyncJob) batch processing You must load or assign this property before you can read its value. 
I:2013-04-03T17:06:37 (EEAttachments.exe)=>(SyncJob) Filecontent is equal: D:\Fotos-Attachments\Extracted\20130306_163911.jpg 
E:2013-04-03T17:06:37 (EEAttachments.exe)=>(SyncJob) batch processing You must load or assign this property before you can read its value. 
I:2013-04-03T17:06:37 (EEAttachments.exe)=>(SyncJob) Filecontent is equal: D:\Fotos-Attachments\Extracted\20130306_163658.jpg 
E:2013-04-03T17:06:37 (EEAttachments.exe)=>(SyncJob) batch processing You must load or assign this property before you can read its value. 
I:2013-04-03T17:06:38 (EEAttachments.exe)=>(SyncJob) Filecontent is equal: D:\Fotos-Attachments\Extracted\20130306_163707.jpg 
E:2013-04-03T17:06:38 (EEAttachments.exe)=>(SyncJob) batch processing You must load or assign this property before you can read its value. 
I:2013-04-03T17:06:38 (EEAttachments.exe)=>(SyncJob) Filecontent is equal: D:\Fotos-Attachments\Extracted\20130306_165012.jpg 
E:2013-04-03T17:06:38 (EEAttachments.exe)=>(SyncJob) batch processing You must load or assign this property before you can read its value. 
I:2013-04-03T17:06:39 (EEAttachments.exe)=>(SyncJob) Filecontent is equal: D:\Fotos-Attachments\Extracted\20130306_164837.jpg 
E:2013-04-03T17:06:39 (EEAttachments.exe)=>(SyncJob) batch processing You must load or assign this property before you can read its value. 
Have I made a mistake? Is this a bug (reading values before they are ready,...)?
Does anybody have an idea how to solve this?

Thanks!
User avatar
Sven
Site Admin
Posts: 1535
Joined: Sun Jan 06, 2008 9:54 pm
Contact:

Re: Run program on email with multiple attachments

Post by Sven »

The Bug seams to be solved by a new Version I have sent and also exchanged online.
Post Reply