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

Using 'getFiles()' in a script gives me files from the wrong folder

New Here ,
Nov 12, 2019 Nov 12, 2019

Copy link to clipboard

Copied

Hi, I'm having a bizzare issue when I try to create an array of files in a folder which I think I've narrowed down to the getFiles() function.

 

Here's a script I have that' sintended to display a filename from a folder of .tif files on my machine

 

 

 

var path = new Folder("D:\Client\Headboards TIF\Batch 1\Head");
var fileList = path.getFiles();
alert(fileList[3].name);

 

 

 

But instead of seeing one of these tif files, it gives me this an alert reading 'AdobeLinguistic.dll' which is a file from photoshop's root folder, nowhere near where I asked it to look!

 

Thi ahppens when I use a string for the folder and when I ahve the user select a folder themselves via selectDlg(). Does anyone have any insight as to why I keep getting an array of files from photoshop's install folder?

 

I'm using a fully up-to-date Photoshop 2020 on a Windows 10 machine.

 

Thank you all in advance!

 

EDIT: Solved this directly after posting, it turns out my problem was calling the variable 'path'. After renaming this now works as intended!

 
TOPICS
Actions and scripting

Views

258

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
no replies

Have something to add?

Join the conversation
Adobe