Ever wanted to get the names of the images in the current document that are attachments? This short code snippet does it in @Formula:
allowed:="jpg" : "gif" : "png" : "bmp"; attNames:=@LowerCase(@AttachmentNames); n:=1; s:=""; @While (n <= @Elements(allowed); m:=1; @While(m <= @Elements(attNames); s:=s : @If( @RightBack(attNames[m]; ".") = allowed[n]; attNames[m]; "" ); m:=m + 1 ); n:=n + 1 ); @Trim(s)
This tip applies to R6.x, where it's possible to create loops. If anyone has achived the same in R5.x, or have a better alternative to the above, please let me know.