-
1. Re: Import Text Data to text fields with folder level script
George_Johnson Jul 27, 2014 11:04 PM (in response to Jo_2013)Try using an app.beginPriv() just before the importTextData statement and an app.endPriv() statement just after. Be sure to restart Acrobat after editing the JavaScript file.
-
2. Re: Import Text Data to text fields with folder level script
Jo_2013 Jul 27, 2014 11:25 PM (in response to George_Johnson)Have revised folder level script with begin and end priv statement, still not working, can you please check script and advise where it could be going wrong?
function mailmergeFunction()
{
app.beginPriv()// Import the first row of data from "Mailmerge.txt"
this.importTextData("/h/mail merge/Jo Smith's Things/Mailmerge.txt", 0)
if (typeof cnt == "undefined") cnt = 0;
this.importTextData("/h/mail merge/Jo Smith's Things/Mailmerge.txt", cnt++ % 4)app.endPriv()
}
app.trustedFunction(mailmergeFunction);app.addToolButton({cName: "Mail merge",cExec: "mailmergeFunction()",cTooltext: "Mail Merge",cEnable: true,nPos: 14});
-
3. Re: Import Text Data to text fields with folder level script
George_Johnson Jul 28, 2014 12:01 AM (in response to Jo_2013)Hmmm..., that looks OK to me. It's strange that there are no errors reported.
-
4. Re: Re: Import Text Data to text fields with folder level script
Jo_2013 Jul 28, 2014 3:57 PM (in response to George_Johnson)Working fine now, changed the location of the file path - could have been something to do with having an apostrophe.
function mailmergeFunction()
{
app.beginPriv()// Import the first row of data from "Mailmerge.txt"
this.importTextData("/h/mail merge/Mailmerge.txt", 0)
if (typeof cnt == "undefined") cnt = 0;
this.importTextData("/h/mail merge/Mailmerge.txt", cnt++ % 4)app.endPriv()
}
app.trustedFunction(mailmergeFunction);app.addToolButton({cName: "Mail merge",cExec: "mailmergeFunction()",cTooltext: "Mail Merge",cEnable: true,nPos: 14});
Thank you for your assistance George, much appreciate your help.
-
5. Re: Import Text Data to text fields with folder level script
Jo_2013 Aug 12, 2014 9:26 PM (in response to George_Johnson)
I am now using the import text data folder level script assigned to a button and it is working by stepping through the records.The only issue is that after the last record is reached, the first record is shown again when the button is clicked.
Can you please advise how to revised the script so that the count stops after the last record (end the loop).
Thank you.


