Page 1 of 1

Help with Array

Posted: Wed Oct 16, 2013 5:45 am
by Nakia
Hi,

I am trying to send an email with attachments which need to be all files in a specific folder.
I have come up with the below but I can figure out how to get x (the incrementing repeat loop variable) into the tAttachments Array...

Code: Select all

   set the defaultFolder to specialFolderPath("temporary")
   repeat with x =1 to the number of lines of the files
      put URL ("binfile:" & specialFolderPath("temporary")&slash&line x of the files) into tAttachments[x]["data"]
      put "text/xml" into tAttachments[x]["type"]
      set the itemdel to slash
      put item -1 of (specialFolderPath("temporary")&slash&line x of the files) into tAttachments[x]["name"]
      set the itemdel to comma
   end repeat
I have tried for example but the IDE doesn't like it

Code: Select all

put "text/xml" into tAttachments[&x&]["type"]
I am sure it's very simple

Re: Help with Array

Posted: Wed Oct 16, 2013 6:02 am
by Nakia
Hang on, turns out I might have got it right...seems like it's working...