Skip to main content
K.Daube
Community Expert
Community Expert
September 14, 2021
Answered

ExtendScript mystery

  • September 14, 2021
  • 1 reply
  • 156 views

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 has been closed for replies.
Correct answer frameexpert

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 */);

1 reply

frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
September 14, 2021

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 */);