Chilton Posted December 3, 2013 Share Posted December 3, 2013 I am creating a saddle-stitched document with two text frames on a single spread, repeated over four pages (8 text frames). As a way to insert specific page breaks, and to drive default content when the text flow stops and there are empty frames, I need to determine the current text frame name so I can name the next sequential one and drive the content there. Simply linking the frames in a specific order has proven too simple and the data flow is too varied to make this a viable option. I am trying to use the following code to get the current Text Frame Name:var currentFrame = FindTextFrame(FusionPro.Composition.CurrentFlow.name); return currentFrame;Unfortunately, when validating, I get the following error:/Library/Application Support/PTI/FusionPro/Buoltins.js, line 3113: Error: In FindFrame(), no frame name specified How am I supposed to retrieve the current frame name with this function? I have combed the Forums, and found no specific example of grabbing the current text frame name and using it in a rule to drive content. Thanks, in advance, for any help! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 3, 2013 Share Posted December 3, 2013 As the name denotes, the FusionPro.Composition object and its properties are valid only at composition time, not at rule validation time. There is no context of a "current text frame" when you're just validating the rule in the Rule Editor, so I'm not sure what you would expect to happen. So, even though you get an error when you validate the rule in the editor, it should work when you compose or preview, as long as you have the "Re-evaluate this rule for every text flow" box checked. What you might want to do is put the code into a conditional block based on the FusionPro.inValidation property, like so: if (!FusionPro.inValidation) { var currentFrame = FindTextFrame(FusionPro.Composition.CurrentFlow.name); return currentFrame; } //else return "Frame name not available at rule validation time."; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.