Expand my Community achievements bar.

SOLVED

Macro to change font colors (with exeption)

Avatar

Level 2

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 ?

1 Accepted Solution

Avatar

Correct answer by
Level 10

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].

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

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].