1 person found this helpful
Does VB take an index as an argument?
Set pgs = InD.ActiveDocument.Pages.ItemByRange(InD.ActiveDocument.Pages.item(149), InD.ActiveDocument.Pages.item(152))
Thanks a gain for taking a crack at this. Unfortunately I've tried that. I'm beginning to think it just isn't in the VB model, or something.
VB has a TypeName() function that returns a string with the type of variable passed. So when a text frame is selected and I do this:
set MyTxtFrame = InD.Selection(1)
I get a message box that says "TextFrame."
When I pass pgs to TypeName I get "Objects" and when I pass pgs(1) I get "Page" so I'm nearly sure the collection is getting created OK. I can even set the AppliedMaster of one of the pages within the collection like this:
pgs(1).AppliedMaster = InD.ActiveDocument.MasterSpreads("LNG-TXT")
It's just the darn application of the master to the collection that simply doesn't work.
Currently I'm building a string that is the Java code and running the DoScript command, which works MUCH faster than itterating through all the pages.
Ah. I seem to remember that itemByRange in VB is a VB functionality which is really more of an array than an InDesign collection. You can't use methods or set properties to arrays. It only works for collections.
I don't use VB, so my memory is a bit fuzzy.
Try checking the type of the object you get from ItemByRange. What is it?
Just just as TypeName(pgs) returns "Objects," this:
also returns "Objects."
Something, somewhere made me think that you work primarily in Windows. True? Do you have any recommendations for a development environment for Java scripts? Preferrably something that has a GUI for developing forms?
Ken Krugh wrote:
Something, somewhere made me think that you work primarily in Windows. True?
Nope. My primary machine is Mac.