hopkinsprinting Posted November 16, 2023 Share Posted November 16, 2023 Hi everyone, I have a letter that is 4 versions. The base art is the same across all 4 versions, it's just the letter that is variable (and each letter has variables within the paragraphs of text). Normally, I would just process this as 4 versions but because this will mail, the associated mailing lists have been combined into one list. In looking at the documentation for FP, it looks like maybe objects can be hidden/shown with a JavaScript rule but I am not able to make sense of it. As I have no experience with JavaScript, could someone please provide the code to achieve this? Thank you so much, jm Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted November 16, 2023 Share Posted November 16, 2023 One way to do this is stack all the text frames on top of each other and turn them all off via script. Then turn on the one that's needed. Make a new Event rule for OnRecordStart and add this: FindTextFrame("Name1").suppress = true; FindTextFrame("Name2").suppress = true; FindTextFrame("Name3").suppress = true; FindTextFrame("Name4").suppress = true; if (Field("Version") == "Ver1") FindTextFrame("Name1").suppress = false; else if (Field("Version") == "Ver2") FindTextFrame("Name2").suppress = false; else if (Field("Version") == "Ver3") FindTextFrame("Name3").suppress = false; else if (Field("Version") == "Ver4") FindTextFrame("Name4").suppress = false; You need to name your text frames appropriately and swap out the names in the script with whatever is in your document. The "Ver1", "Ver2", etc values should be whatever value would be in your Version field to determine which frame gets turned on. If this doesn't work out for you, I would suggest posting your template and sending a sample data file that doesn't contain anything personal in it. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 21, 2023 Share Posted November 21, 2023 On 11/16/2023 at 4:22 PM, ThomasLewis said: One way to do this is stack all the text frames on top of each other and turn them all off via script. Then turn on the one that's needed. Make a new Event rule for OnRecordStart and add this: FindTextFrame("Name1").suppress = true; FindTextFrame("Name2").suppress = true; FindTextFrame("Name3").suppress = true; FindTextFrame("Name4").suppress = true; if (Field("Version") == "Ver1") FindTextFrame("Name1").suppress = false; else if (Field("Version") == "Ver2") FindTextFrame("Name2").suppress = false; else if (Field("Version") == "Ver3") FindTextFrame("Name3").suppress = false; else if (Field("Version") == "Ver4") FindTextFrame("Name4").suppress = false; You need to name your text frames appropriately and swap out the names in the script with whatever is in your document. The "Ver1", "Ver2", etc values should be whatever value would be in your Version field to determine which frame gets turned on. If this doesn't work out for you, I would suggest posting your template and sending a sample data file that doesn't contain anything personal in it. This is equivalent to: for (var i = 1; i <= 4; i++) FindTextFrame("Name" + i).suppress = (Field("Version") != "Ver" + i); If you have groups of frames that you want to show and hide, you can set up named frame groups in the Document Overview palette and call HideFrameGroup or ShowFrameGroup. Quote Link to comment Share on other sites More sharing options...
hopkinsprinting Posted November 27, 2023 Author Share Posted November 27, 2023 Hi Thomas and Dan, Your suggestion worked like a charm! THANK YOU SO MUCH!!! Best regards, jm 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.