Jump to content

VernF88

Registered Users - Approved
  • Posts

    12
  • Joined

Converted

  • FusionPro Products
    No

VernF88's Achievements

Rookie

Rookie (2/14)

  • First Post Rare
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

10

Reputation

  1. I'm pretty sure a modification of this code could help me. I have a similar situation with three variables in a text frame. The text frame reads: "<<V1>> <<V2>> <<V3>>." The result I'm getting when <<V3>> is empty is: "<<V1>> <<V2>> ." How can I remove the space between "<<V2>> ." without just deleting the static text in the text frame?
  2. Sorry my photo was too large I just now noticed I'm uploading a resized photo.
  3. I uploaded an image for my meaning. Next to the large "$13,555" are the superscript characters I'm wanting to correct with the rule. As you'll see in the next paragraph down next to the "$1,500 Bonus Cash" the "+" character is the correct height. So the global setting cannot be modified to fix the issue. The code I have in the rule's correct the height and insure they aren't bold: return FormatNumber("$#,###", Field("Actual").replace(/[^\d\.-]/g,'')) + "<p br=false superoffset=175 superratio=30><span bold=false><superscript>++</superscript></span bold=false><p br=false superoffset=58 superratio=50>" That will produce the correct height "++". Literally whats in the text frame is "<<actual>>++" so I input: var chars = { // Find: Replace: '\\^': '<superscript>^</superscript>', '\\+': '<superscript>+</superscript>', '†': '<superscript>†</superscript>', '‡': '<superscript>‡</superscript>', '<<first>>': Field("First Name"), '<<last>>': Field("Last Name"), '<<year>>': Field("Year"), '<<make>>': Field("Make"), '<<model>>': Field("Model"), '<<model2>>': Field("Model2"), '<<model3>>': Field("Model3"), '<<V1>>': Field("V1"), '<<V2>>': Field("V2"), ' <<V3>>': Rule("V3R"), ' <<V4>>': Rule("V4R"), '<<V5>>': Field("V5"), '<<v1>>': Field("V1"), '<<v2>>': Field("V2"), ' <<v3>>': Rule("V3R"), ' <<v4>>': Rule("V4R"), '<<v5>>': Field("V5"), '<<more>>': Rule("MoreR"), [color="Red"]'<<actual>>\\++': Rule("ActualR1"), '<<actual>>\\+': Rule("ActualR2"), '<<actual>>†': Rule("ActualR3"), '<<actual>>‡': Rule("ActualR4"),[/color] '<<actual>>': Rule("ActualR"), '<<winno>>': Field("WinNo"), } var text = FindTextFrame('FullBody').content .replace(/<variable name="([^"]*)">/g, function(s,p) { return FieldOrRule(p); }) .replace(/&([lg])t;/g, function(s,p) { return p == 'l' ? '<' : '>'; }); for (var i in chars) text = text.replace(new RegExp(i, 'g'), chars[i]); FindTextFrame('FullBody').content = text; I realize I could highlight and replace the space holder but that's literally the last thing left in the letter that isn't automated. I appreciate all your help!
  4. The only other thing I'm struggling on with this is trying to get something like this to work: '<<actual>>++': Rule("ActualR1"), '<<actual>>+': Rule("ActualR2"), '<<actual>>†': Rule("ActualR3"), '<<actual>>‡': Rule("ActualR4"), The reason being is the "actual" field in the letter is 36 point, so the superscript doesn't go up high enough. I made 4 rules applying each occurrence of the character options at the appropriate superscript height. It won't recognize this as text within the frame though. Thank You!
  5. That works great! Thank you again for all your help!!!
  6. Hello Dan, Currently we've been attempting this: var chars = { // Find: Replace: '\\^': '<superscript>^</superscript>', '\\+': '<superscript>+</superscript>', '\\†': '<superscript>†</superscript>', '\\‡': '<superscript>‡</superscript>', '<<first>>': Field("First Name"), '<<last>>': Field("Last Name"), '<<year>>': Field("Year"), '<<make>>': Field("Make"), '<<model>>': Field("Model"), '<<model2>>': Field("Model2"), '<<model3>>': Field("Model3"), '<<V1>>': Field("V1"), '<<V2>>': Field("V2"), '<<V3>>': Rule("V3R"), '<<V4>>': Rule("V4R"), '<<V5>>': Field("V5"), '<<more>>': Rule("MoreR"), '<<actual>>': Rule("ActualR"), '<<winno>>': Field("WinNo"), } var text = FindTextFrame('FullBody').content .replace(/<variable name="([^"]*)">/g, function(s,p) { return FieldOrRule(p); }); for (var i in chars) text = text.replace(new RegExp(i, 'g'), chars[i]); FindTextFrame('FullBody').content = text; The rub is that the field's aren't filling because of the "<<>>" on each side of the space holder. Also the alt characters "†" and "‡" aren't being replaced with superscript.
  7. Okay for troubleshooting purposes I input 'first' instead of '<<first>>'. It then inserted the field, so it's the <<>> characters causing it to not work properly. Still not sure why the "†" and "‡" characters are not going to superscript though.
  8. Here's what I've got after completing what I would want done in the format above: var chars = { // Find: Replace: '\\^': '<superscript>^</superscript>', '\\+': '<superscript>+</superscript>', '\\†': '<superscript>†</superscript>', '\\‡': '<superscript>‡</superscript>', '<<first>>': Field("First Name"), '<<last>>': Field("Last Name"), '<<year>>': Field("Year"), '<<make>>': Field("Make"), '<<model>>': Field("Model"), '<<model2>>': Field("Model2"), '<<model3>>': Field("Model3"), '<<V1>>': Field("V1"), '<<V2>>': Field("V2"), '<<V3>>': Rule("V3R"), '<<V4>>': Rule("V4R"), '<<V5>>': Field("V5"), '<<more>>': Rule("MoreR"), '<<actual>>': Rule("ActualR"), '<<winno>>': Field("WinNo"), } var text = FindTextFrame('FullBody').content .replace(/<variable name="([^"]*)">/g, function(s,p) { return FieldOrRule(p); }); for (var i in chars) text = text.replace(new RegExp(i, 'g'), chars[i]); FindTextFrame('FullBody').content = text; The only thing that is affecting inside of the text frame is the "+" and "^" characters. Am I keying something wrong?
  9. When I add in "†" and "‡" characters the rule doesn't seem to move them, also is there a way to make a similar rule to replace place holders? For example "<<first>>" being automatically replaced with "Field("First Name")"?
  10. Hello, I have a customer who sends us documents that are plastered with disclaimer characters (ex. +, ^, etc.) that they expect us to change to superscript. Currently we highlight each disclaimer character in the text frame and click the "sup" button. I attempted javascript to remedy this with the code provided here modified for my purposes. Is it possible to locate and replace characters within a text frame to superscript? Thank you. Here is my attempt: FusionPro.thisRuleReturnsTaggedText = true; var myFrame = FindTextFrame("FullBody"); myFrame = ReplaceSubstring(myFrame, "+", "<superscript>+</superscript>"); return myFrame;
×
×
  • Create New...