Copy link to clipboard
Copied
Can anyone help how to save selected image save in local drive in inDesign uxp code structure. below given code is not working for me.
Copy link to clipboard
Copied
I don't think your exportFile arguments are correct. I don't think they have changed from JSX to UXP. Think you need to pass a valid File object, but I don't have the API in front of me.
Copy link to clipboard
Copied
• Function saveImage is defined but not executed. Use `await saveImage()` to execute it
• Change the export image type 'JPG' passed to exportFile to ExportFormat.JPG or 1246775072. ExportFormat must be required by yourself
const { app, ExportFormat } = require('indesign') ;
• You have to specify a destination path for exportFile
const os = require('os') ;
const dstFolder = path.join(os.homedir(), 'Desktop') ;
imageCopy.exportFile(ExportFormat.JPG, path.join(dstFolder, 'sample.jpg')) ;