• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ExtendScript mystery

Community Expert ,
Sep 14, 2021 Sep 14, 2021

Copy link to clipboard

Copied

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?

TOPICS
Scripting

Views

107

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 14, 2021 Sep 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 */);

Votes

Translate

Translate
Community Expert ,
Sep 14, 2021 Sep 14, 2021

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines