Placing a graphic from the local file system in Indesign UXPScript
I am surprised this is so hard. No recipe in the docs seems to cover this. Here's what I am trying to do:
const imageFrame = targetPage.rectangles.add();
const imageFile = fs.readFileSync(`${DATA_FOLDER_PATH}/${imageFileName}`);
const placedImage = imageFrame.place(imageFile);
imageFrame.geometricBounds = [yStart, xStart, yEnd, xEnd];
The error alert says that the first argument to place isn't being supplied. This isn't quite right, of course. In the console I can see that the file is being located in the file system. `imageFile` is an `ArrayBuffer` so it's not that. How do I pass the File into `place`?
Thanks in advance for any help.
