Jump to content

NoahScheitler

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by NoahScheitler

  1. Hello,

    Quick programming question here. I am working on making a rule for a page switch and cant seem to find something similar here to apply to my situation.

    Currently i have 3 pages in this job: A common front and two backs that interchange.

    The back pages are identical with the exception of a text box that populates the page with text, one is set with 14.5 pt absolute leading spacing and the other with 13.5 pt leading spacing.

    If the 14.5pt page is used by default how could i check to see if the text has too many lines to fit in this box and if so switch to the 13.5 pt page?

    Thanks,

  2. Good morning everyone,

    I was just wondering if it would be possible to output the total processing time for a job in the .msg log. I tried adding code to OnJobStart and OnJobEnd to get the current time and then subtract those two values but i just keep getting 0:0:0 every time. Would this be possible even? My javascript knowledge is very limited.

    I am using fusion pro 7.2P1k btw (yes very old i know but its all i have to work with)

  3. For this all you need to do is create a new blank javascript rule.

    For the programming of the rule enter: return CurrentRecordNumber() + " of 10"

    Then insert that rule in your text box and you should be good to go.

     

    • Like 1
  4. 19 hours ago, Dan Korn said:

    Can you be more specific about what's not working?

    Dan,

    After looking at it i think i was just misunderstanding how the syntax works here. It was just saying "Function does not return a value" when i validated it. I see what you are saying now though.

    I used your much simpler code and it worked just the same. I'm pretty new to javascript so i'm still trying to figure things out.

    Appreciate the help, Thanks!

    • Like 1
  5. Hello,

    I have a situation where i have the same 3 text boxes on multiple pages. They are labeled as "Barcode", "Non Barcode", and "Indicia".

    I was just wondering if it is possible to write a switch function with a single variable that suppresses multiple same named pages.

    For example: if the IMBarcode field is present suppress "Non Barcode". If it is not present suppress "Barcode" and "Indicia"

    function handleBarcodeAndIndiciaFrames(imb) {

    var Barcode = FindTextFrame("Barcode");

    var NoBarcode = FindTextFrame("NoBarcode");

    var Indicia = FindTextFrame("Indicia");

    try {

    var test = imb.toLowerCase();

    NoBarcode.suppress = true;

    } catch (e) {

    Barcode.suppress = true;

    Indicia.suppress = true;

    }

    }

    If i have 15 pages with these text boxes is there a way to have 15 "Barcode" frames suppress with that single variable? Or am i forced to name the variables uniquely as in "Barcode1", "Barcode2", etc?

     

  6. 3 hours ago, NoahScheitler said:

    Im trying to make a .js text file to store a function within fusion pro. I want to then be able to simply call these functions out rather than copying files from older versions.

    I made one for a MatchCode that works currently it takes a 7 char string and returns the 5 rightmost chars.

    The second one im working on wont seem to work however. It should be returning the info for a datamatrix code, im wondering if its the MakeDataMatrixBarcode function within causing the issue.

    The first function that works is:

    function MatchCode(str)

    {

    str = Right(Field("Match"), 5);

    return str;

    }

    The function that doesnt work is:

    function datamatrix(str)

    {

    str = MakeDataMatrixBarcode(Field("Match"), true, "TEXT", 2, 3, false, "IDAutomationDMatrix");

    return str;

    }

    After messing around with this for a while i realized the function that makes MakeDataMatrixBarcode work is located in Builtins.js.

    So i copied the code for that and replaced the variables with my values and it works now. Here is the code for reference:

    function DataMatrixBarcode(ProcessTilde, EncodingMode, PreferredFormat, PointSize, NoFontTag, Font)
    {
    this.processTilde = true;
    this.encodingMode = "TEXT";
    this.preferredFormat = 2;
    this.pointSize = 3;
    this.noFontTag = false;
    this.font = "IDAutomationDMatrix";
    }
     
    //__________________________________________________________________
     
     
    DataMatrixBarcode.prototype.Encode = function(DataToEncode)
    {
    return EncodeDataMatrixBarcode(Field("Match"), this.processTilde, this.encodingMode, this.preferredFormat);
    }
     
    DataMatrixBarcode.prototype.Make = function(DataToEncode)
    {
    var encoded = this.Encode(Field("Match"), this.processTilde, this.encodingMode, this.preferredFormat);
     
    var ReplacedBR = ReplaceSubstring(encoded, "\r\n", "<br>");
    var ReplacedSpaces = ReplaceSubstring(ReplacedBR, " ", "");
     
    if (!Int(this.pointSize))
    return ReplacedSpaces;
     
    var WithPointSize = "<z newsize=\"" + Int(this.pointSize) + "\">" + "<leading newsize=\"" + Int(this.pointSize) * 10 + "\">" + ReplacedSpaces;
    if (this.noFontTag)
    return WithPointSize;
     
    var WithFontTag = "<f name=\"" + this.font + "\">" + WithPointSize;
     
    return WithFontTag;
    }
     
    function datamatrix(DataToEncode, ProcessTilde, EncodingMode, PreferredFormat, PointSize, NoFontTag, Font)
    {
    return new DataMatrixBarcode(ProcessTilde, EncodingMode, PreferredFormat, PointSize, NoFontTag, Font).Make(DataToEncode);
    }
     
  7. Im trying to make a .js text file to store a function within fusion pro. I want to then be able to simply call these functions out rather than copying files from older versions.

    I made one for a MatchCode that works currently it takes a 7 char string and returns the 5 rightmost chars.

    The second one im working on wont seem to work however. It should be returning the info for a datamatrix code, im wondering if its the MakeDataMatrixBarcode function within causing the issue.

    The first function that works is:

    function MatchCode(str)

    {

    str = Right(Field("Match"), 5);

    return str;

    }

    The function that doesnt work is:

    function datamatrix(str)

    {

    str = MakeDataMatrixBarcode(Field("Match"), true, "TEXT", 2, 3, false, "IDAutomationDMatrix");

    return str;

    }

×
×
  • Create New...