Copy link to clipboard
Copied
I have:
var mDoc = app.activeDocument;
if(app.activeDocument.modified){
app.activeDocument.save();
}
myFilename = app.activeDocument.fullName.toString();
mPathDoc = app.activeDocument.fullName;
if (myFilename.match(".indd") !=null){
myFilename = myFilename.split(".")[0]+"_test.idml";
}
app.activeDocument.save(File(myFilename)); --- this line does work!
mDoc.exportFile(ExportFormat.INDESIGN_MARKUP, myFilename); this line DOES NOT WORK!
// script says: "Cannot find the folder" - though the same folder in previous line
Copy link to clipboard
Copied
Hi,
exportFile expects a file as target not a string:
mDoc.exportFile(ExportFormat.INDESIGN_MARKUP, File(myFilename));
Copy link to clipboard
Copied
Uphhh... Many thanks!
Copy link to clipboard
Copied
In continue...
Why not exporting (see beneath)?
var mDoc = app.activeDocument;
mPath = mDoc.filePath.parent + '/' + "tmp";
mSpellName = mPath + "/" + "spelling.idml";
aSpell = mSpellName.toString();
myFilename = app.activeDocument.fullName.toString();
//~ mPathDoc = app.activeDocument.fullName;
if (myFilename.match(".indd") !=null){
myFilename = myFilename.split(".")[0]+"_spelling.idml";
}
mDoc.exportFile(ExportFormat.INDESIGN_MARKUP, File(myFilename)); //DOES Work
mDoc.exportFile(ExportFormat.INDESIGN_MARKUP, File(mSpellName)); //DOES NOT?
mDoc.exportFile(ExportFormat.INDESIGN_MARKUP, File(aSpell)); //DOES NOT?
Copy link to clipboard
Copied
Hi,
mPath = mDoc.filePath.parent + '/' + "tmp";
filePath.parent is a Folder (object) not its path (string) so you can't adding string to this.
use:
mPath = mDoc.filePath.parent.fullName + '/' + "tmp";
rgds
Copy link to clipboard
Copied
Thanks for hint!