Skip to main content
Inspiring
July 5, 2023
Answered

Using the same form in more than one operating system

  • July 5, 2023
  • 4 replies
  • 3967 views

I have a form that is used on both my Mac and Windows computers. It uses both document level and folder level scripts. The folder level scripts are identical on the two computers.

 

A menu item calls four folder level scripts that save different fdf files to 4 subfolders under the same parent folder.  On the Mac, all four scripts work as intended. On the PC, the first of the four scripts works but the other three seem to be completely ignored. No errors are thrown.

 

For purposes of my question, please assume the path to the subfolders is correctly structured. So here’s my question: are anomalies that are characterized by some scripts not quite working right somewhat common when using the same form on more than one operating system?

This topic has been closed for replies.
Correct answer Thom Parker

Security settings in Acrobat could easily block data export. This would be reported in the Console.  

Have you check your security preferences? Is Protected Mode turned on?  

 

Have you tried running the non-working scripts from the console window?

 

 

4 replies

try67
Braniac
July 5, 2023

Scripts in Acrobat are 99.9% platform-independent, meaning they should work just the same on both Windows and Mac computers. When the script doesn't work on Windows, is there an error message of some kind? Did you check the JS Console?

ODuinnAuthor
Inspiring
July 6, 2023

Sorry for the slow response. Yes, the console is reporting this:

"GeneralError: Operation failed.
Doc.exportAsFDF:7:Field btn.Image.Folder:Mouse Up"

To repeat briefly, the only difference between the Mac version and the Windows version of my form are the paths with file names for the fdf files that saved by the scripts. Otherwise the scripts are exactly the same and work on the Mac but only partially on the PC.

The scripts construct absolute paths for each fdf file to be saved. The paths, file names and extensions are passed to the folder level scripts by parameters. I placed an app alert in each folder level script that shows me the path & file name represented by each "pathAndFile" parameter below, and confirmed that the path and filename for each is correctly constructed as "/C/Users/Dropbox/MyFolder/MyFile.fdf"

As to the console message, here are extracts of each instance of exportAsFDF from my folder level scripts, but I see nothing wrong with these:

this.exportAsFDF({bAllFields: true, cPath: "" + pathAndFile});
this.exportAsFDF({bAllFields: true, cPath: "" + pathAndFile});
this.exportAsFDF({bAllFields: true, aFields: ["txtProperty", "txt.Property"], cPath: "" + pathAndFile});
this.exportAsFDF({bAllFields: true, aFields: ["txtP","txtE", "txtSB", "chkTypeInd", "chkTypeCorp"], cPath: "" + pathAndFile});

And, once again, the scripts work with the mac but on the PC, just the first instance of exportAsFDF() in my scripts works, the rest do not.

try67
Braniac
July 6, 2023

Why are you exporting twice to the same file path in a row?

JR Boulay
Braniac
July 5, 2023

The PDF form scripts work identically on both platforms. The problem certainly lies elsewhere.

Acrobate du PDF, InDesigner et Photoshopographe
ODuinnAuthor
Inspiring
July 5, 2023

Yes, and that's why I asked my question. When the scripts work in Mac with no problem, they should work on on a PC also. 

Thom Parker
Thom ParkerCorrect answer
Inspiring
July 5, 2023

Security settings in Acrobat could easily block data export. This would be reported in the Console.  

Have you check your security preferences? Is Protected Mode turned on?  

 

Have you tried running the non-working scripts from the console window?

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Braniac
July 5, 2023

It's rarely the operating system. Did you check the JavaScript console? (You say "no errors are thrown" but some people assume JavaScript errors will result in a pop-up message). 

ODuinnAuthor
Inspiring
July 5, 2023

I wasn't suggesting that it was the operating system, but rather asking if it is known that when using the same form in Acrobat on different operating systems, there occasionally may be something that works just fine in one system but not the other. I prefaced that by saying for purposes of my question, please assume the path to the subfolders is correctly structured because I know that that is not the issue.

Bernd Alheit
Braniac
July 5, 2023

The same version of Adobe Acrobat?

Why does you use four folder level script files for one menu item?

ODuinnAuthor
Inspiring
July 5, 2023

Because sometimes I call only one of them rather than all four.