Macro to change font colors (with exeption) | Community
Skip to main content
New Participant
September 17, 2021
Solved

Macro to change font colors (with exeption)

  • September 17, 2021
  • 1 reply
  • 766 views

Hello.

 

When updating my forms, I usually put all changes in red to ensure we know were to look during review.

I would like to use a macro to remove all these red in regular text boxes, field captions, etc. en replace them with black.

Except for text that contain an url link (They should be blue)

How would you do that ?

I guess, finding all "

<fill>
<color value="255,0,0"/>
</fill>"

and remove them unless when url is present then, replace "255,0,0" by a blue color.

 

Not sure how to do that,

 

Can you help ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by radzmar

Create a text file with following content.

var oNodes = designer.filterNodeTree(xfa.template, "value", "255,0,0");
for (var i = 0; i < oNodes.length; i += 1) {
	oNodes.item(i).value = "0,0,0";
}

Save that file as .js  file (i.e. my Macro.js). 

Create a new folder under the macro folder of you LiveCycle or AEM Forms Designer (i.e. C:\Program Files (x86)\Adobe\Adobe Experience Manager Forms Designer\EN\Macros\MyMacros) and paste you .js file there. 

Open your form in Designer an execute your new macro from [Tools] > [Macros].

1 reply

radzmar
radzmarAccepted solution
New Participant
October 5, 2021

Create a text file with following content.

var oNodes = designer.filterNodeTree(xfa.template, "value", "255,0,0");
for (var i = 0; i < oNodes.length; i += 1) {
	oNodes.item(i).value = "0,0,0";
}

Save that file as .js  file (i.e. my Macro.js). 

Create a new folder under the macro folder of you LiveCycle or AEM Forms Designer (i.e. C:\Program Files (x86)\Adobe\Adobe Experience Manager Forms Designer\EN\Macros\MyMacros) and paste you .js file there. 

Open your form in Designer an execute your new macro from [Tools] > [Macros].