You simply place the ICML-File into a Textframe:
// optional unlink
you could check what placeable file extensions can be used:
// Result for e.g. InDesign CS6 v8.1.0 on Mac OSX:
AI AIF AIFF AU AVI BMP CT DCS EMF EPS F4V FLV GIF JPE JPEG JPG M15 M1A M1S M1V M64 M75 MOV MP2 MP4 MPA MPEG MPG MPM MPV PCC PCT PCX PDD PIC PMG PNG PSD RLE SCT SWF TIF TIFF TP1 TRP TXT WAV WAVE WMF doc doc docx icml idms incd incx indd inds indt joboptions mp3 oam pdf pdp rtf txt utxt xls xlsx
However, I did not test, if all of these will work for the Mac version.
And InDesign will be agnostic on cases:
E.g. myDocument.jpg and myDocument.JPG will work alike.
I also noticed that line breaks and spaces in the ICML file are replicated exactly, including page breaks that I haven’t quite figured out where they come from.
There is no wrapper for String or Stream. I would write a temporary file to disk.
grefel, is it possible that the place() function works differently on 2015.4 (126.96.36.199) than it does on my 188.8.131.52? I ask because a customer does not see any content of the placed ICML file, and since I don’t have that version of InDesign I can’t really test...
I'm quite sure that place() works the same way in 2015.4 (184.108.40.206) and 2017 and all the other version since I started scripting with CS3.
To check: Do you use the mentioned code block with unlink: