Don't see any reason for the outer substitute function calls as it appears that they replace a space with a space...
Modify your calculation to remove all bullet characters before doing the substitute to replace returns with the "ReturnBullet" text.
And you can use the [ ] syntax instead of nesting calls to substitute.:
Substitute (Feature ; ["l " ; "" ] ; [ TextFont (TextSize ( "¶l "; 7); "Wingdings") ] )
Thanks for the suggestion - just tried it but getting error message : 'too few parameters in this function'
What am I missing?
I'm missing a parameter in what I suggested:
Substitute ( "Feature" ; ["l " ; "" ] ; [ ¶ ; TextFont (TextSize ( "¶l "; 7); "Wingdings") ] )
I'm afraid your revision still is not working - no bullets are added.
Basically I want to paste in or write text in the field so when field is committed/exited I want each paragraph to be preceded by a bullet and tab. but not to add further bullets/tabs when later amendments are made.
I used " ¶" so I could use find and replace script but I suspect this is causing the double bullets?
¶ to become/reformat as:
¶ # [tab] xxxxxxx
¶ # [tab] xxxxxxx
I played around with this in my Data Viewer feeding different text to the calculation. To keep the expression simple, I used a # instead of the bullet character. I was always a bit surpriesed that you weren't having an issue with the very first item on your list not getting a bullet. The following fixes that issue as well as inserts # where needed without doubling them if one is already there:
Let ( [ t = Substitute ( YourFieldHere ; "#" & Char ( 9 ) ; "" ) ; // all existing bullet-tab character pairs are removed here
t1 = Substitute ( ¶ & t ; ¶ ; "¶#" & Char ( 9 ) ) ] ; // a leading return is added so that all items have a return in front and then bullet-tabs added
Right ( t1 ; Length ( t1 ) - 1 ) // leading return is removed from text.
You would subsitute each use of # with the expression you'd need to put the bullet character from wingdings in place.
A great big thank you - fantastic! It works!
Months of frustration finally ended!
I adapted your calculation as follows:
Let ( [ t = Substitute ( MyField; "l" & Char ( 9 ) ; "" ) ;
t1 = Substitute ( ¶ & t ; ¶ ; TextFont (TextSize ( "¶l" & Char ( 9 ); 7); "Wingdings") ) ] ;
Right ( t1 ; Length ( t1 ) - 1 )