List all files in a folder

Hi,
I am new to Director.
I am using Director to record/save/ listen to audio files.
I want to populate a list with all the files in a given
folder.
Anyone know how to do this in Director?
Thanks

> You could use the built-in getNthFilenameInFolder()
I could have been more specific:
on mGetFileList aPath
tList = []
repeat with f = 1 to the maxInteger
tFilename = getNthFilenameInFolder(aPath, f)
if tFilename = EMPTY then exit repeat
tList.append(tFilename)
end repeat
return tList
end
And call it with:
lFiles = mGetFileList(_movie.path)
However, the above will also list folders

Similar Messages

  • How to Read all files inside resource Folder inside Jar?

    I have a Jar file,,,, The program reads for resource files in the resource folder inside the Jar. I want my program to read all files inside this folder without knowing the names or the number of files in the folder.
    I am using this to make an Applet easy to be updated with spicific files. I just want to add a file inside the resource folder and Jar the program and automatically the program reads what ever is in there!!
    I used the File class to get all file names inside the resource folder. it works fine before Jarring the program. After I jar I recieve a URI not Herarichy Exception!!
    File fold=new java.io.File(getClass().getResource(folder).toURI());
    String[] files=fold.list();
    I hope the question is clear!!

    How to get the directory and jar file that you class resides in:
    // returns path and jarfile (ex: /home/mydir/my.jar)
    public String getJarfileName()
            // Get the location of the jar file and the jar file name
            java.net.URL outputURL = YourClass.class.getProtectionDomain().getCodeSource().getLocation();
            String outputString = outputURL.toString();
            String[] parseString;
            int index1 = outputString.indexOf(":");
            int index2 = outputString.lastIndexOf(":");
            if (index1!=index2) // Windows/DOS uses C: naming convention
               parseString = outputString.split("file:/");
            else
               parseString = outputString.split("file:");
            String jarFilename = parseString[1];
           return jarFilename;
    }If your my.jar was in /home/mydir, it will store "/home/mydir/my.jar" in jarFilename.
    note: getLocation returns "file:/C:/home/mydir/my.jar" for Windows/DOS and "file:/home/mydir/my.jar" for windows, thus why I look for the first and last index of the colon so I can correctly split the string.
    If you want to grab a file in the jar file and get an InputStream, do the following:
    import java.io.*;
    import java.util.Enumeration;
    // jar stuff
    import java.util.jar.*;
    import java.util.zip.ZipEntry;
    public class Jaris
       private JarFile jf;
       public Jaris(String jarFilename) throws Exception
           try
                           jf = new JarFile(jarFilename);
           catch (Exception e)
                jf=null;
                throw(e);
       public InputStream getInputStream(String matchString) throws Exception
           ZipEntry ze=null;
           try
              Enumeration resources = jf.entries();
              while ( resources.hasMoreElements() )
                 JarEntry je = (JarEntry) resources.nextElement();
                 // find a file that matches this string from anywhere in my jar file
                 if ( je.getName().matches(".*\\"+matchString) )
                    String filename=je.getName();
                    ze=jf.getEntry(filename);
          catch (Exception e)
             throw(e);
          InputStream is = jf.getInputStream(ze);
          return is;
       // for testing the Jaris methods
       public static void main(String[] args)
          try
               String jarFilename=getJarfileName();
               Jaris jis = new Jaris(jarFilename); // this is the string we got from the other method listed above
               InputStream is=jis.getInputStream("myfile.txt"); // can be used for xml, xsl, etc
          catch (Exception e)
             // this is just a test, so we'll ignore the exception
    }Happy coding! :)
    Doc

  • List all files in a directory on a server that hosts the applet

    Hei :)
    I have a problem. I want to list all files in a directory on my server. ( http://www.foo.bar/tw )
    The applet is in the root folder ( http://www.foo.bar ).
    So i tried it like this
    File fi = new URL(getCodeBase() + "/all/").getFile();But when I try to list the files, I get a SecurityException.
    Can anyone help me out?
    Peace!
    LoCal

    http://search.java.sun.com/search/java/index.jsp?col=javaforums&qp=&qt=%2Blist+%2Bfile+%2Bserver

  • Printing a list of files in a folder

    Is it possible to print a list of files in a folder?

    Thanks for all your work-arounds. Here's a comparison which might be useful for others:
    • Copying and pasting into a text file or word processor gave me a list of the titles;
    • Dragging onto a printer in the dock gave me title, size and date; a little difficult to read across the lines as they are spaced across the whole width of my A4 page;
    •Print Window (free version) gives a printout of the information in the window that you choose. The lines are quite widely spaced which makes it legible, but means it takes a lot of pages for a big folder;
    • Print Window Advanced ($20) allows you to out put as a file, so you can design a format that suits you. I use Excel a lot for these kinds of tasks so this suits me very well. You can also print our a format for cd covers which—useful for archiving.

  • Convert list of files in a folder to text?

    Is there an easy way to convert the list of files in a folder into a text document? In other words I would like to create a text list of the names of all the files in a given folder - just the individual file names, not the entire path of each file.
    Any ideas? Seems like there should be some simple way to do this.
    Thanx!

    If you copy the desired items in a Finder window and do a *Paste and match Style* into a TextEdit document, the file names will be pasted in. If you have TextWrangler (or BBEdit), dragging a folder into a document will give also you a list of the contents.

  • [Solved] Foreach loop that loops over all files in a folder does not consider first file found

    Hello,
    I have a foreach loop in SSIS (as part of Visual Studio 10 and with SQL Server 2012).
    It loops over all files in a folder (ForEach File Enumerator).
    I set the folder: OK
    Traverse Sub folders: OK
    I have set up a Variable in Variable Mappings called FileName so it shows User::FileName: OK
    Index of variable is 0: OK
    It almost works ok. Except that the first file it finds is never considered.
    I set a breakpoint then and the first file it finds, is shown in black in the watch variable window. All subsequent files found are shown in red font. When I change the names of the files so another file is the first file found then it skips the other one
    which now is the first file.
    What is going on here? Why does SSIS skip the first file it finds in a foreach file loop?
    Any suggestions highly appreciated.
    Thank you
    Andi
    Andreas

    "red font - interesting, any example to show us (image)
    It would be interesting to share with us whether you use any file masks or expressions.
    Arthur
    MyBlog
    Twitter
    It appears a variable value turns red when it changes between breakpoints. It started black for the first value (the first file, obtained BEFORE the execution reached the breakpoint), and then turned red. I was able to reproduce this behavior on a test environment.
    However, it did not skip any files.
    OP, please set up the test shown in the image below. Create a breakpoint in the sequence container for the "OnPreExecute" event.

  • How to list all files in my system

    Hi there,
    I want to list all files in my system. My system is Windows XP, can anybody help me please? Any can you recommend me if java is suit for such processing?
    Thx in advance.

    public void showFilesIn(File dir) {
        File[] files = dir.listFiles();
        for (int i = 0 ; i < files.length ; i++)
            if (files.isDirectory())
    showFilesIn(files[i]);
    else
    System.out.println(files[i]);
    showFilesIn(new File("C:\\"));
    notice that it won't show directories, but only files

  • 10.6.4:  how to unlock all files in a folder

    hi,
    how do you unlock all files inside a folder?
    thank you..

    thank you.. (I wonder why you can't just do it by getting info on the folder, then saying, unlock all files inside.. (u can do like that in windows) this is always more practical than having to select all files (and accidentally opening them, or something...-) in windows you can select a folder and then say, (un)lock all files and and dirs -- and subdirs and files inside -- inside this folder.. can u do something like this in mac os? if not, that's not very good.. (I guess on the mac would need to find unix commands for doing something like this..)
    they really need to consider this for future versions, this is a no-brainer...;-)
    thank you..

  • Database query in MaxL DBS-Name list all file information failed

    When I tried list all file information command in MaxL it gave me an error saying the user doesn't exist. When I check the user through display user; command in MaxL I get the information as listed below.
    Is there something wrong with the way the user was created ?
    How can I (Admin) get the index and data file information?
    MAXL> query database Application.Database list all file information;
       ERROR - 1051012 - User ADMIN@Native Directory does not exist.
    MAXL> display user;
    user                description         logged in           password_reset_days enabled             change_password     type                protocol
       conn param          application_access_
    +-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-----------------
    --+-------------------+-------------------
    ADMIN@Nati                                    TRUE                   0                TRUE               FALSE                   3 CSS
       native://DN=cn=911,                   1

    Has anyone resolved the problems with using TNSFormat?
    As is, I want to move to a shared server setup and to do that I want to use TNSFormat and point to a tns entry which is setup for IPC+Shared connection.
    But the Oracle Home that has the Oracle HTTP Server (from the companion CD) does not have SQL*net installed and does not seem to understand TNS.
    I have TNS_ADMIN setup, I have ORACLE_HOME_LISTENER poiting to the DB Home.
    for the OHS home, using "sqlplus login/pw@ipcshared" works, but "tnsping ipcshared" does not, since tnsping does not exist in the OHS home.
    I cannot install SQL*Net from the CD1, since it requires a dedicated/new home and does not want to install in the OHS Home.
    The only format that works in a dedicated OHS Home setup is ServiceNameFormat.
    Any help or input would be very helpful.
    Regards
    ps. This is a redhat linux setup.
    Message was edited by:
    Oli_t

  • List of files in Windows folder

    Hi,
    It wanted to know if it is possible to get the liste of file from a folder on the server with PL-SQL
    Thanks,

    > Why?
    A database is not a flat file system!
    What relevance this sentence holds wrt OP's question ? Does "database being a flat file system" really help ? OP is asking for some way to list out files in a folder.
    Sidhu

  • Add all files of one folder to aperture by running a script

    HI,
    i have a question:
    I will make my Aperture Tethered more easy (with my Canon eos 30D) i have coded a script / folder action to do this but: this folder action does not import all pictures (wy ever, i think that the files coming in to fast were not recognized).
    Now i will code a script which will include all files of a folder to aperture when it is run.
    i will give it a try, and the import does function, but, i don't know how i can tell the script which files it should import (with a folder action its easy, with this line:
    on adding folder items to this_folder after receiving these_items
    but how to do this without the "on adding folder items" cause that does not happen in the case i will use it.
    i'm looking forward to anthers:D
    Best Regards
    Christoph

    yes i tryed this application, and there was the same problem as with my one (i have programmed my based on this application)
    but both had the same problem they open on imageadd, but if i take more images in seconds (i think the script is still running => it can't recognize new images) it does not recognize the newly taken images.
    and i hope some script that imports all images in the folder will solve the problem.
    the more ore less only problem is to tell the application which images to import (like: on run import ALL files)

  • Read all Files from a Folder on Server

    Hi,
    Can anyone help me in finding if there's any way to read all files in a folder on the server?Any Function module or anything.
    Thanks

    On App server?  Try this sample program.
    report zrich_0001 .
    data: begin of itab occurs 0,
          rec(1000) type c,
          end of itab.
    data: wa(1000) type c.
    data: p_file type localfile.
    data: ifile type table of  salfldir with header line.
    parameters: p_path type salfile-longname
                        default '/usr/sap/TST/DVEBMGS01/data/'.
    call function 'RZL_READ_DIR_LOCAL'
         exporting
              name           = p_path
         tables
              file_tbl       = ifile
         exceptions
              argument_error = 1
              not_found      = 2
              others         = 3.
    loop at ifile.
      format hotspot on.
      write:/ ifile-name.
      hide ifile-name.
      format hotspot off.
    endloop.
    at line-selection.
      concatenate p_path ifile-name into p_file.
      clear itab.  refresh itab.
      open dataset p_file for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset p_file into wa.
          if sy-subrc <> 0.
            exit.
          endif.
          itab-rec = wa.
          append itab.
        enddo.
      endif.
      close dataset p_file.
      loop at itab.
        write:/ itab.
      endloop.
    Regards,
    Rich Heilman

  • List all files in project

    Hello,
    Is there any way to list all files and their paths used in a after-effect project (using extended script)?
    Thanks

    David Torno already wrote that wonderful script.
    You can get it here:
    http://aescripts.com/projectinfolistexporter/

  • List all file namess under a dba_directory.

    Guys,
    It there any way that I can get all the file names in a dba_directory..
    ie.
    SQL> select * from dba_directories;
    OWNER DIRECTORY_NAME DIRECTORY_PATH
    SYS ATTACH_FILES C:\PLSQL
    Now I'm looking for a SQL query\PL-SQL block to list all file names under C:\PLSQL.
    Guidance plz.
    Thanks,
    Bhagat

    There's an Ask Tom thread here:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:439619916584
    shows how to do this with a Java stored procedure.
    HTH
    Regards Nigel

  • CDM 4650 / ACNS - List all files in a channel?

    Hello,
    I am looking for a non-cumbersome way to list all files in a channel. The only way I know of right now is to go to the CDM Admin Page, go to Previewer, and then view the channel, which is split among many pages and has much extraneous information I don't care about -- I just want the filename in the channel for any given channel.
    I was given a way to do this by Cisco which doesn't work, so I was looking for any other solutions. Thanks!

    I have not seen a non-cumbersome way to do this. You say that a Cisco engineer gave you a way to do it but it did not work. You should contact them to let them know it did not work and maybe they can work with you to get it to work.

Maybe you are looking for

  • IPhone won't charge... Does anyone know how to fix this?

    Well i think that's the problem anyway..Here's the story: I got pretty caught up playing a game on my phone when the little msg flashed "20% battery life left" or however that goes. I figured hey its late I'll just charge it when I'm done and go to b

  • Can't print on photo paper

    Please help before I jump off my roof!!!! Hi, I have just purchased a new HP Envy 5530 specifically to print photos. The guy in the store also sold me a pack of Kodak A4 premium photo paper and said it would work fine. When I try and print pictures i

  • PDFs are always printed 2 pages per sheet

    My system was reformatted recently and everything had to be reinstalled. Acrobat Reader XI (11.0.2) and Acrobat Pro 9 (9.0.0*) are now having problems when printing PDFs: every PDF is always printed at 2 pages per sheet. The resulting 4-point type pr

  • Grabbing word docs in iPad to print

    How can I convert word docs to PDF for printing out? As the system currently works printed documents are poor. Doesn't recognise bottom and following top margins so rolls over and cuts off a line - perhaps!!

  • Can I copy a download from the App Store?

    I have an iMac and a MacBook, so obviously I need to install any app on both computers.  I know that I only have to pay once, but is there a way to transfer the new download (or updated app) from one computer to the other?  The problem is bandwidth: