🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
5 messages
5 total messages Started by Malcolm Wooden Thu, 12 Mar 2009 14:48
JS TextColumnCount not working.
#512
Author: Malcolm Wooden
Date: Thu, 12 Mar 2009 14:48
31 lines
1374 bytes
I have a simple JS to create a new 6 column document, however I cannot get 'TextColumnCount' to work. Can anyone see where I'm going wrong here?
Thanks

var myDocument = app.documents.add();
with(myDocument.documentPreferences){
	pageHeight = "297mm";
	pageWidth = "210mm";
	pageOrientation = PageOrientation.portrait;
	facingPages = false;
}
with(myDocument.textDefaults){
	kerningMethod = "Metrics";
	appliedFont = "Arial";
}
with(myDocument.pages.item(0)){
	with(marginPreferences){
		columnCount = 6;
		columnGutter = "4.233mm";
		bottom = "12.7mm";
		left = "12.7mm";
		right = "12.7mm";
		top = "12.7mm";
	}
	with(textFrames.add()){
		geometricBounds = ["12.7mm", "12.7mm", "284.3mm", "197.3mm"];
		contents = "This is some text";
		with(TextFramePreference){
			TextColumnCount = 6;
		}
	}
}
Re: JS TextColumnCount not working.
#513
Author: Kasyan_Servetsky
Date: Thu, 12 Mar 2009 14:54
2 lines
635 bytes
with(textFramePreferences){
textColumnCount = 6;
Re: JS TextColumnCount not working.
#514
Author: Malcolm Wooden
Date: Thu, 12 Mar 2009 15:11
3 lines
726 bytes
Kasyan

I don't think that's correct, it doesn't run. The debugger comes back with "textFramePreferences undefined".
Re: JS TextColumnCount not working.
#515
Author: Kasyan_Servetsky
Date: Thu, 12 Mar 2009 15:53
36 lines
1484 bytes
Malcolm,

I changed these two lines and it works for me. I'm posting the whole script.

Kasyan



var myDocument = app.documents.add();
with(myDocument.documentPreferences){
   pageHeight = "297mm";
   pageWidth = "210mm";
   pageOrientation = PageOrientation.portrait;
   facingPages = false;
}
with(myDocument.textDefaults){
   kerningMethod = "Metrics";
   appliedFont = "Arial";
}
with(myDocument.pages.item(0)){
   with(marginPreferences){
      columnCount = 6;
      columnGutter = "4.233mm";
      bottom = "12.7mm";
      left = "12.7mm";
      right = "12.7mm";
      top = "12.7mm";
   }
   with(textFrames.add()){
      geometricBounds = ["12.7mm", "12.7mm", "284.3mm", "197.3mm"];
      contents = "This is some text";
      with(textFramePreferences){
         textColumnCount = 6;
      }
   }
}
Re: JS TextColumnCount not working.
#516
Author: Malcolm Wooden
Date: Thu, 12 Mar 2009 16:09
5 lines
740 bytes
Kasyan

Thanks - yes that works, not sure why mine didn't though, perhaps there is something in the formatting.

thanks again.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads