sschardan Posted March 31, 2014 Share Posted March 31, 2014 I have a repeating job that is producing sets of contact sheets for images. It is a single page with 8 graphic frames and a hidden text frame, then an overflow page of the same format. One time I will get a set of data that has fields named "Field 1" to "Field 56". This will result in a pdf of 7 pages with 8 images each per record. Next time, I will get data that is "Field 1" to "Field 98", which would need 13 pages per record. What I am currently doing in my rule that is triggering the activation of my overflow pages is manually entering the quantity for all the rules that start with "Field ". What I am wondering is if it is possible to automate this count so I no longer have to edit this rule every time. Just wondering.... Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted March 31, 2014 Share Posted March 31, 2014 Well, I would set up the job a bit differently, to have just the single body page and repeat it, instead of using Overflow pages. But for what you're doing, if you want to count the number of fields, you can just do something like this: for (numFields = 0; ; numFields++) { try { Field("Field " + (numFields + 1)); } catch (e) { break; } } // Now numFields is set to the number of fields named "Field x", where "x" is a number, in the job. // So do something here with numFields, such as returning it, for example: return numFields;This can be done in either OnRecordStart or OnJobStart. Quote Link to comment Share on other sites More sharing options...
sschardan Posted April 1, 2014 Author Share Posted April 1, 2014 Dan, As usual, your solution works perfectly. Thank you very much. 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.