Answered
Delete Folder using CEP extension InDesign
I want to delete a temporary folder which I created in AppData Roaming.
Is there any API whch helps in doing that using CEP extension for InDesign?
I want to delete a temporary folder which I created in AppData Roaming.
Is there any API whch helps in doing that using CEP extension for InDesign?
You can use node module fs to delete the file. Below is the simple code that you try
var fs = cep_node.require('fs');
if (fs.existsSync(path)) {
var file = path + fileName;
fs.unlink(file, (err) => {
if (err) {
console.error(err)
return;
}
})
} else {
console.log(path + ' does not exists. So file is not deleted.')
}
Where path varaibale is the path where file exists and fileName= actualName of the file.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.