Trusted Function to import text does not work in Reader but does in Acrobat.
I have a form at work that I am trying to setup so that it will import data from a text file.
I have got it to work in Adobe Acrobat PRO (Continuous Release | Version 2024.003.20112 | 64-bit).
Unfortunately, it does not work in Adobe Acrobat Reader (Continuous Release | Version 2024.003.20112 | 64-bit).
I have placed the trusted function in the user folder. I used " app.getPath('user','javascript')" in the console to find the correct location.
My question is, can Adobe Acrobat Reader do this and if it can, could someone please check the code below to advise me what I am doing wrong. If reader can't do it, so be it.
Code placed in the user folder
//Code from Adobe Acrobat Community Post "Run "importTextData" on a form button", reply posted by Bernd Alheit, Community Expert, May 22, 2019
var myImportTextData = app.trustedFunction(function(cPath)
{
app.beginPriv();
this.importTextData(cPath);
app.endPriv();
});
Code placed in the text field of the form. Action - On Focus.
myImportTextData("/C/Users/*******/Desktop/Import Text/AmbTherm.txt");
I also would like to send a big thank you to (in no particular order), Bernd Alheit (thanks for the code above), Karl Heinz Kremer, TRY67 and Nesa Nurani.
When I started early this year, I had absolutely no idea about javascript (or Acrobat at all). While every one on this forum has taught me something, the four of you have had the greatest impact, so THANK YOU.
