September 6, 200916 yr I have a number of help layouts. They have graphical components so am unable to create them as simple text fields/records, rather there are a number of individually numbered layouts with the various help screens. All of the help screens are named HELP_#. I will be adding to them at anytime. Each one can be individually opened via the ? on screen with a go to layout (HELP_ + get(scriptparameter)) I am trying to create a script that will dynamically loop through all of the help layouts and print/append them to a pdf. Everything is working fine, with the exception that the go to layout step will not work. The calculation works fine (i.e HELP_02 should be the next layout) but the blimmen thing just won't go there : Here is my script so far Go To Layout Help01 Set Variable $$filename Set Field [gcounter right(get(layoutname);2) + 1] Save records as PDF $$filename Loop Go to Layout "Help_" & if (gcounter < "10"; "0"; "") & gcounter **this pads the number with a 0 if less than 10** Exit Loop if "Help_" & if (gcounter < "10"; "0"; "") & gcounter <> get(layoutname) save records as pdf [color:red]*appended[/color] set field gcounter right(get(layoutname); 2 + 1) End Loop I've also tried variations of getasnumber/getastext with no help : So essentially the script needs to HELP_01 *print HELP_02 *print HELP_03 *print and so on, until the next number e.g HELP_04 doesn't exist so the script exits. TIA
September 7, 200916 yr Try: Go to Layout [ “HELP_01” ] Save Records as PDF [] Loop Exit Loop If [ IsEmpty ( FilterValues ( SerialIncrement ( Get ( LayoutName ) ; 1 ) ; LayoutNames ( Get (FileName) ) ) ) ] Go to Layout [ SerialIncrement ( Get ( LayoutName ) ; 1 ) ] Save Records as PDF [] End Loop Go to Layout [ original layout ]
September 7, 200916 yr Author That worked beautifully. Thanks so much. Didn't know serialincrement existed. Cheers
Create an account or sign in to comment