Skip to main content
Inspiring
February 6, 2012
Question

myFile.documentPreferences.facingPages=ARGH

  • February 6, 2012
  • 1 reply
  • 824 views

If I run the line:

app.activeDocument.documentPreferences.facingPages=false

I get exactly the results I want.

If I to run this:

var myFolder = Folder.selectDialog();

var files = myFolder.getFiles ();

for(i = 0, l = files.length; i <l; i++) {

         myFile = app.open(files, true)

        myFile.documentPreferences.facingPages=false

myFile.close(SaveOptions.YES);

}

InDesign crashes!

What am I doing wrong? I feel like this should work no problem. I feel like I already had to working! Haha anyways I hope there is a simple explanation for a simpleton like me.

Thanks,

Kurtis

This topic has been closed for replies.

1 reply

Inspiring
February 6, 2012

I'd have to guess you're picking up some files that aren't InDesign files. Try:

var files = myFolder.getFiles("*.indd");

Jeff

KuddRowwAuthor
Inspiring
February 6, 2012

That wasn't it but thank-you for the detective work!

Turns out some of the files are semi-corrupted. I can't even change the setting using the GUI.

Problem "solved"...

KuddRowwAuthor
Inspiring
February 10, 2012

I ended up converting the file into IDML and back to INDD and that solved the hiccup. Weird behaviour...