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

prototype issue

Engaged ,
Mar 17, 2017 Mar 17, 2017

Copy link to clipboard

Copied

Hi all,

I'm trying to add a method on the prototype of an object.

I put these objects into an array called changes by doing new Changes.

Then I call the method using:

changes[0].createTable();

Why does it not work?

function Changes ( changedBy, changedOn, changeType, change, changeFrom, changePage, row ) {

    this.changedBy = changedBy;
    this.changedOn = changedOn;
    this.changeType = changeType;
    this.change = change;
    this.changeFrom = changeFrom;
    this.changePage = changePage;
    // use row to control how many rows the table needs
    this.row = row;

}

Changes.prototype.createTable = function () {

    // set the document properties to A4 margin 10mm make the text frame fill  the page
    app.documents.add( );
    var doc = app.activeDocument;

    var textFrame = doc.pages[0].textFrames.add ( {geometricBounds: [12.7,12.7,284.299999999461,197.299999999936] } );

    // add the content to a table
    //if a table exists then add a new row
    }

TOPICS
Scripting

Views

137

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
no replies

Have something to add?

Join the conversation