• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can i add a second Modification Date Text Variable?

Advocate ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

I'm trying to add a second Variable to make the date M/yy.  I have something like it below but when i Click on Define Text Variable to double check it it is a Custom Text and not Modification Date.  My main fear is that it will not automatically update the Date.  If this will Keep updating the Date let me know and i'll just leave it as is.  Also if there is a cleaner way to do let me know.  Thank you.

      tvLn = doc.textVariables.item("L#");

      !tvLn.isValid && tvLn = doc.textVariables.add({name:"L#", variableType:VariableTypes.CUSTOM_TEXT_TYPE});   

      tvLn.variableOptions.contents = String( getDateString() );

         

                   

var R1, R2;      

      myTableMOD.columns[0].contents = columnOneContentsArray;       

      myTableMOD.columns[1].contents = columnTwoContentsArray;       

            

      R1 = cell5OfColumn2insertionPoint1.textVariableInstances.add(LocationOptions.AFTER, cell5OfColumn2insertionPoint1);

      R1.associatedTextVariable = doc.textVariables.itemByName("getDateString");

  var cell5OfColumn2insertionPoint1 = myTableMOD.columns[1].cells[1].insertionPoints[0];     

   

        }       

     

           function getDateString() { 

var date = new Date(); 

var month = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; 

     

    // Handle zero prefix 

var formatDate = ("/" + date.getFullYear()).substr(-2); 

  

    return month[date.getMonth()] +"/" + formatDate; 

   

    } 

TOPICS
Scripting

Views

286

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Apr 05, 2017 Apr 05, 2017

This just might work if i can edit it correctly.  Thank you.  I'll mark correct if i get it to work.

Votes

Translate

Translate
Guru ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 05, 2017 Apr 05, 2017

Copy link to clipboard

Copied

LATEST

This just might work if i can edit it correctly.  Thank you.  I'll mark correct if i get it to work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines