Page 1 of 1

Remove double spaces and caps?

Posted: Wed Nov 25, 2020 4:50 pm
by gelat
I used replacement matrix to remove all " " with " " (double spaces to one space) and checked case and regex - it doesn't work.

I then added in my script,

sTmp:= tg_getField('Title');
Sys_ApplyCase(sTmp,5,True);
tg_SetField ('Title',sTmp);

and it won't change the title at all, or trigger the replacement matrix

I have it set to update BOTH

Re: Remove double spaces and caps?

Posted: Wed Nov 25, 2020 5:49 pm
by jtclipper
You don't need to check regex or case, just type a double space and a single space
Then make sure that in your work flow that matrix is used and it targets the fields you want

If you prefer a script then use

Code: Select all

sys_ApplyMatrix
//example, first parameter is the matrix ordinal number
tg_setField( 'Title', sys_ApplyMatrix( 1, tg_getField('Title') );
and not

Code: Select all

sys_ApplyCase

Re: Remove double spaces and caps?

Posted: Wed Dec 02, 2020 7:43 pm
by gelat
As always - thanks!

Can't wait for 64bit version !

Re: Remove double spaces and caps?

Posted: Wed Dec 02, 2020 7:59 pm
by gelat
I'm getting an error

"Compiling...
Compiler: [Error] (78:68): comma (',') expected

Here are the lines of code

Line 78

tg_setField( 'Title', sys_ApplyMatrix( 1, tg_getField('Title'));

Re: Remove double spaces and caps?

Posted: Thu Dec 03, 2020 7:35 am
by jtclipper
Need another parenthesis at the end

Code: Select all

tg_setField( 'Title', sys_ApplyMatrix( 1, tg_getField('Title') ) );