Skip to main content
K.Daube
Community Expert
Community Expert
Sep 14, 2021 4:09 PM UTC
Answered

ExtendScript mystery

Dear all,

By some erraneous editing i have situations like this:

var oDoc, oFile, sFile;
  oFile
  sFile = oFile.fullName.toUpperCase();  // Uppercase the filename for easy comparison.
...

The second line should read

  oFile = File(filename);

For me it's a mystery why this 'stand-alonge' variable does not create a syntax error or similar during the start of the script in ESTK. Only at line 3 I get the error - of course the varible (oFile) is undefined.

Can you enlighten me?

This topic is closed to new replies. Start a new post to keep the conversation going.
frameexpert
frameexpertCorrect answer
Community Expert
Sep 14, 2021 4:47 PM UTC

Technically, there is nothing wrong with having just the variable name, but of course, you want something like this:

 

oFile = new File (/* a file path in here */);

www.frameexpert.com

1 reply

frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
Sep 14, 2021 4:47 PM UTC

Technically, there is nothing wrong with having just the variable name, but of course, you want something like this:

 

oFile = new File (/* a file path in here */);

Translate
www.frameexpert.com