Jump to content

Help adding space to this script


Recommended Posts

I had this script written for me sometime ago. Now I need to use it again with a space added between the : following the phone labels and the phone fields. I don't now anything about java so any help would be appreciated.

Here is the current script

// "Bubble" phones and format onto one or two phone lines

// based on phone count. Line breaks will use leading

// set in copyhole by default.


//the phone rule in the var should display label and formatted phone or


var PhonesArray = [


Field("phone2label") +Rule ("phone2rule"),

Field("phone3label") +Rule ("phone3rule"),



var PhonePosition = [], PhonesCount = 0, j = 0;


for (i = 0; i < 3; i++)


if (PhonesArray != "")


{ PhonePosition[j+1] = PhonesArray; j++ ;PhonesCount++ }




// adjust the line-breaks accordingly

if (PhonesCount == 3)


{ return Rule("phone1rule")+" &bull " + Field("phone2label")+ Rule ("phone2rule")+'<br>'+

Field("phone3label")+ Rule("phone3rule") +" &bull "+ Field("emaillabel")+Field ("email"); }


else if (PhonesCount == 2)


{ return Rule("phone1rule")+" &bull " + Field("phone2label")+Rule ("phone2rule")+'<br>'+

Field("emaillabel")+ Field ("email"); }


if (PhonesCount == 1)


{ return Rule("phone1rule")+'<br>'+

Field("emaillabel")+ Field ("email"); }

Link to comment
Share on other sites

I don't see where a colon is being added in your code so I'll assume it's coming from values for fields "emaillabel", "phone3label" and "phone2label". If this is correct, then you could change the code wherever it calls for these fields to read:

Field("YOURFIELD").replace(":", " : ")

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...