It seems that the concatenation in AppleScript doesn’t let you easily append text to a string variable. I have the following line that would work in most other languages:
repeat with thisRecpt in recipients of eachMessage
set recp to recp & "," & address of thisRecpt
end repeat
From what I can tell, this doesn’t seem to work in AppleScript, as you cannot use the recp variable within the same line apparently. Is there any easier way of adding text to the end of a variable without having to use two variables within the loop?
Thanks!
The code you posted works fine as long as
recpis set to something first, say"". However, you’ll then get a,as the first character in your string, which is probably not what you want.Instead, you can do this:
Yes, it’s ugly, but it’s more efficient and you’ll only get “,” between addresses.