• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Why i can't export into IDML [JS-CS6]?

Explorer ,
Feb 09, 2013 Feb 09, 2013

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

TOPICS
Scripting

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 09, 2013 Feb 09, 2013

Copy link to clipboard

Copied

Hi,

exportFile expects a file as target not a string:

mDoc.exportFile(ExportFormat.INDESIGN_MARKUP, File(myFilename));

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 09, 2013 Feb 09, 2013

Copy link to clipboard

Copied

Uphhh... Many thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 10, 2013 Feb 10, 2013

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 11, 2013 Feb 11, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 11, 2013 Feb 11, 2013

Copy link to clipboard

Copied

LATEST

Thanks for hint!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines