🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting
1 messages
1 total messages Started by gtrfrk213 Thu, 17 Feb 2005 17:02
Acrobat JavaScript DataObjects
#37
Author: gtrfrk213
Date: Thu, 17 Feb 2005 17:02
25 lines
2017 bytes
I am trying to read in a counter number from a file, add one to that
counter, and write the new one back to that file.  Right now, I have a
file called "c" sitting next to my pdf.  It is prompting me to find the
file, and again name it when i export the value.  I dont think i'm
getting the value out of the dataobject right.  Here is my code:

    //get value from file
    this.createDataObject("c", "0");
    this.importDataObject("c");
    //var d = this.dataObjects;

    //get int value out & inc
    var newc = parseInt(this.getDataObject("c"));
    newc++;

    //set value to Counter field and export
    this.getField("Counter").value = newc;
    this.exportDataObject("Counter");

if I substitute this.exportDataObject("c"); in the last line, I get a
file that has the original number in it.  So I know that I am
importing/exporting it right, but I dont seem to be getting the actual
value out since it always exports the number 12 for Counter.  Can
anyone tell me how to get the value out of the DataObject and translate
it into an integer?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads