Remove double spaces and caps?

Use this forum for everything concerning script usage
Post Reply
gelat
Newbie
Newbie
Posts: 34
Joined: Sat Nov 20, 2010 10:02 pm

Remove double spaces and caps?

Post 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

User avatar
jtclipper
Administrator
Administrator
Posts: 768
Joined: Tue Aug 10, 2010 12:04 pm

Re: Remove double spaces and caps?

Post 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

gelat
Newbie
Newbie
Posts: 34
Joined: Sat Nov 20, 2010 10:02 pm

Re: Remove double spaces and caps?

Post by gelat »

As always - thanks!

Can't wait for 64bit version !

gelat
Newbie
Newbie
Posts: 34
Joined: Sat Nov 20, 2010 10:02 pm

Re: Remove double spaces and caps?

Post 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'));

User avatar
jtclipper
Administrator
Administrator
Posts: 768
Joined: Tue Aug 10, 2010 12:04 pm

Re: Remove double spaces and caps?

Post by jtclipper »

Need another parenthesis at the end

Code: Select all

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

Post Reply