Skip to main content
亮太中57270486
Participating Frequently
Sep 16, 2019 11:45 AM UTC
Question

Scriptでファイルの一覧を表示する方法

例えばなんですが、デスクトップに置いてあるファイルの一覧をScriptでalertできますでしょうか?

可能であればCS6.0でも使えるものが知りたいです。

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Tomas Sinkunas
    Legend
    Sep 16, 2019 1:15 PM UTC

    Totally doable. Here's one way to do that:

    var path = '~/Desktop';
    var folderObject = new Folder(path);
    var folderItems = folderObject.getFiles();
    
    alert(folderItems.join('\n'));

     

    You can read more about Folder object here:http://estk.aenhancers.com/3%20-%20File%20System%20Access/folder-object.html

    Translate
    亮太中57270486
    Participating Frequently
    Sep 17, 2019 1:33 AM UTC
    You are so cool ! thank you!
    Translate