Skip to main content
Participating Frequently
May 27, 2024
Question

Trouble running VS Code to edit scripts

  • May 27, 2024
  • 2 replies
  • 1604 views

I feel like SUCH a scrub but I've never worked in Acrobat before. I downloaded all the extensions I need (I think) but when I add a JS action in my form and hit edit, I get an error in VS code saying the file path doesn't exist. 

I feel like I must be doing something out of order. 

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
May 28, 2024

By VS? do you mean Microsoft Visual Studio? VS has nothing to do with Acrobat scripting. So how exactly are you using it?

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participating Frequently
May 28, 2024

First of all, big fan, thom. 

And no, VS Code not Visual Studio. I read in multiple places that since Adobe stopped supported Extendscript the default way to make scripts not in the app is VS Code. 

I worked it out though. I didn't realize you could call functions in the /CONTENTS/ JavaScript folder from the document. So I'm writing my scripts in VS Code and running them from the document. Just have a few functions I can't GE working quite right but I'm getting there. 

Thom Parker
Community Expert
Community Expert
May 28, 2024

There are several ways to automate Acrobat.  So it is important for you to be explicit so we know what you are talking about, so we know.

 

You mention "not in the app" so I'm assuming you mean to control Acrobat from an external source. In this case you would need to use the IAC, which is an Window's OLE (or Active X) module.   

Here's the reference for the IAC

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/interapp/index.html

 

The IAC can be access from many different programming environments. The most common, and easiest is VB and VBA.  Although it can also be used from C++, C# (and other .Net environs), and possible even ExtendScript, or JavaScript run from the Powershell. But I have not need anything about using the IAC from ExtendScript. 

 

VS Code is not a programming language, but rather a cutdown version of Visual Studio, that is intened for scripting purposes, rather than hard core programming.  I imagine you are using it write ExtendScript to access the IAC?.  From what I've seen this is used for automating  the other Adobe applications, not Acrobat. 

 

But then you said that you used VSCode to add a JS action to a form. So are you using VSCode as the JS editor in Acrobat. This idea is contrary to your first statement about using ExtendScript for externally controling Acrobat. Please be complete and clear in your explanation, so we can provide reasonable help. 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Bernd Alheit
Community Expert
Community Expert
May 27, 2024

What script do you use?