We receive daily sales reports, and flight manifests. The format in the subject should be: dd.mm.yyyy/"two letter airline code".DSR.Weightdd.mm.yyyy/"two letter airline code".DSR.Weight
.
I.e. 30.01.2013/VS.DSR.1110KG 30.01.2013/VS.DSR.1110KG
In the case of the manifest, in the same format, substitute DSRDSR
with MNFSTMNFST
.
I.e. 30.01.2013/VS.MNFST.1110KG 30.01.2013/VS.MNFST.1110KG
.
There are however countless variations to the subject, and we are all human, and sometimes ",",
is used, or more "/"/
etc. Our staff are great and work extremely hard, and the last thing they need me to do is be on their case about subject formats.
Therefore I was trying to get an Applescript to look at the two things that are always in the subject. The airlines two letter code, and the word "DSR"DSR
or "MNFST/MFST/Manifest"MNFST/MFST/Manifest
"CV" "VS" "SAA" "TK" "DHV" "LH"CV
VS
SAA
TK
DHV
LH
Now the "DSR"DSR
can be in the subject in a number of ways, its not always seperated, ie. 30.01.2013/VSDSR1110KG 30.01.2013/VSDSR1110KG
Same applies for MNFST/MFST/ManifestMNFST/MFST/Manifest
.
- Check the subject for the flight code and "DSR"
DSR
- Save the .xls attachment to /DSR/Airline two letter code
- If File is more recent (A correction might be sent later that day/early the next morning.), add "1"
1
, if another "2"2
etc.
I.e. 30.01.2013/VS.DSR.1110KG.xls 30.01.2013/VS.DSR.1110KG.xls
: Macintosh HD/Users/(My username)/Dropbox/DSR/VSMacintosh HD/Users/(My username)/Dropbox/DSR/VS
I.e. 30.01.2013/CV.DSR.1110KG.xls 30.01.2013/CV.DSR.1110KG.xls
: Macintosh HD/Users/(My username)/Dropbox/DSR/CVMacintosh HD/Users/(My username)/Dropbox/DSR/CV
- Check the subject for the flight code and (Manifest or MNFST or MFST)
- Save the .xls/.pdf/.zip attachment to Manifests/Airline two letter airline code
- If the file is more recent (I.e. a file conflict with the same name. A correction might be sent later that day/early the next morning.), add "1"
1
, if another "2"2
etc.
I.e. For "VS"VS
: Macintosh HD/Users/(My username)/Dropbox/Manifests/VSMacintosh HD/Users/(My username)/Dropbox/Manifests/VS