Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more