How to traverse folders

hello everyone,
can anybody help me how to traverse folders using scripting?
I want to compress a folder to a zip file using scripting.
thanks

This will leg a list of all files in each folder and sub folders...
var folders =[];
var topLevel = Folder.selectDialog("Please select top level folder");
//get a list of all sub folders
folders = FindAllFolders(topLevel, folders);
folders.unshift(topLevel);
for(var a in folders){
    //get a list of all files in each folder in turn
    var folderList = folders[a].getFiles();
    //do whatever to each file list
function FindAllFolders( srcFolderStr, destArray) {
var fileFolderArray = Folder( srcFolderStr ).getFiles();
for ( var i = 0; i < fileFolderArray.length; i++ ) {
  var fileFoldObj = fileFolderArray[i];
  if ( fileFoldObj instanceof File ) {  
  } else {
         destArray.push( Folder(fileFoldObj) );
  FindAllFolders( fileFoldObj.toString(), destArray );
return destArray;
To get all files in one folder it would be ...
var topLevel = Folder.selectDialog("Please select top level folder");
topLevel.getFiles();

Similar Messages

  • I have 300 apps organized in folders on my ipod touch 4th gen, and connected my iphone 4, these apps have copied over but none have been placed in folders, any ideas how to replicate folders from ipod to iphone...?

    I have 300 apps organized in folders on my ipod touch 4th gen, and connected my iphone 4, these apps have copied over but none have been placed in folders, any ideas how to replicate folders from ipod to iphone...?

    What may work is to restore the iPhone fom the backup of the iPod.  However, if the two devices ahve different apps that come with the device, that may mess up some of the folders.

  • How to traverse repository nodes in weblogic 8.1

    hi ,
    like binary search tree , how to traverse all node in repository .(can have many hierarchy node or content node ) .
    i have to traverse all content and hierarchy node .

    hi raj ,
    actually i have to traverse a node in repository 8.1 ,(like binary search tree).
    like u got a node then u have to check that how many content node /or hierarchy node it have , then check each of its content node/hierarchy node , then again check its child status (content/or hierarchy )same like binary search tree traversal .
    i try to make recursive code for that but not working properly , its searching at 2/3 levels , not at all levels .
    so if u can make recursive method for that i 'll appreciate u .
    thanks
    attaching my code for little help :
    public static void searchNode(Node node){
    if(node.getType()==Node.HIERARCHY){
    try{
    System.out.println( " Hierarchy content +node.getName());
    n=node.getChildren();
    for(int i=0;i<n.length;i++){
    System.out.println("child "+n.getName());
    searchNode(n[i]);
    catch(Exception e)
    System.out.println("");
    else //node.getType()==Node.CONTENT
    try{
         Property p[]=node.getProperties();
         for(int i=0;i<p.length;i++)
    if(p[i].getValue() !=null && p[i].getType() == Property.BINARY )
    System.out.println(" got property file " + p[i].getValue());
                             fname=p[i].getValue().toString();
    System.out.println(" adding "+fname+" these file to array list " );
    al.add(fname);
    System.out.println(" file added ");
    catch(Exception e)

  • How to make folders

    This might have been answered in a different topic but i was just wondering how to make folders in Mail. I don't know if you can but... just a folder i can name and have it say "Friends" and then put the email from my friends in that folder.

    At the menu bar, go to Mailbox and select New Mailbox.
    If you are accessing a .Mac type account or an IMAP account with Mail, the location options are "On My Mac" which is stored locally on the hard drive or the .Mac or IMAP account which will create a server stored mailbox.
    If you aren't accessing a .Mac type account or IMAP, "On My Mac" is your only location choice.
    Enter a name for the mailbox and select OK.

  • How to open folders in hot mail on i phone

    how to open folders in hotmail with i phone

    Well, you tap on the name of the email account, then you tap on the folder you want to open.

  • How to make folders for pitcures on iphone 4

    how to make folders for pitcures on iphone 4?

    sorry about that..Where do i find the replies to my posts?  tks

  • How to traverse repository

    hi ,
    how to traverse repository .i got one node and i have to traverse all node and child node(hierarchy node and content node), like binary search in tree .

    Here's some utiltity code we used in GroupSpace:
    INodeManager nodeManager = ContentManagerFactory.getNodeManager();
    Set<Node> set = new TreeSet<Node>();
    int limit = 1000; // stop after 1000 nodes, can be anything
    ContentContext context = new ContentContext();
    String path = "/" + repositoryName; // whatever that is for you
    // Recurse -- see method below
    recurseRepository(context, path, set, limit);
    // Look at contents
    for (Node node:set)
    System.err.println(node.getPath()); // or whatever
    * Recurse the repository but stop after N nodes
    public static void recurseRepository(ContentContext cc, String path, Set set, int limit) throws Exception
    if (set.size() <= limit)
    Node inNode = nodeManager.getNode(cc, path);
    Node [] nodes = inNode.getChildren();
    for (int i=0; i<nodes.length;i++)
    Node node = nodes;
    set.add(node);
    recurseRepository(cc,node.getPath(),set, limit);
    Hope that helps.

  • How many Library folders should there be, and where?

    How many Library folders should there be, and where?

    Each user has his own. This is where items specific to each user are stored - caches, preferences files, login items, etc. In Lion these folders are hidden, but still there.
    There is also one at the top level of the hard drive. This is where resources shared between users are stored - fonts, application support files, etc.
    There's also one in the System folder, that you may look in, but do not touch.

  • How to view folders with folders first and then files?

    I come from a Windows world but am loving the Mac world! But one thing I haven't been able to figure out is how to view folders with all the folders first and then the files? Right now, it sorts everything in alphabetical order, intermixing the folders and files. I like being able to see the folders sorted at the top and then the files. Is there a way to do this?

    If you want a more advanced browser, Pathfinder generally comes highly recommended.
    I'm not aware of a way to make folders sort on top. I generally detest that feature in Windows, because it messes up keyboard navigation. Both operating systems support jumping to a file by starting to type a name, but on Windows you don't know where you end up. If I have a file called "notes", I know that typing "N" will send me somewhere very close to the file, and a few arrow presses brings me to it - if I do it on a Mac. If I do it on Windows, it depends on what is selected - if it's a folder or nothing, I jump to the first folder beginning with N, but if it's a file, I jump to the first file beginning with N - in a completely different part of the list. I do use folder grouping in some windows on the Mac, though, by adding a space to the name. Ideally, it should be a per-window setting.

  • How to share folders in remote pcs using labview

    how to share folders remotely using labview?
    If there is any connection problem, how to read the file continuosly till there is a signal and get the data?

    You could just use Copy File.  It would be a lot simpler than reading the file and appending to your second file every second.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Copy File.png ‏10 KB

  • How to create folders in video app in IPhone 5...

    Can anyone please tell me how to create folders for different things like movies,video songs in the video app on iPhone 5????...My itunes is up to date and i am using windows 7...

    Right click Target, select Add->New Build Phase->New Copy Files Build Phase.
    And yes, .app is nothing more than a folder (technically a package).
    Eric

  • How to synchronise folders in USB drives to macbook harddisk folder

    How to synchronize folders - from USB drive to a documents folder?

    Here's a fairly inexpensive solution - http://www.greenworldsoft.com/sync-folders-pro-help.html.
    Clinton

  • How to use folders in 'Movies'' and how to right click a file on the ipod?

    Does anyone know how to create folders in the Movies category on the ipod? I would like to get rid of the huge list of movies and create some structure in this category. Is there also a solution to this problem without the need to synchronize video between ipod and computer?
    How do I "right click" a song on my ipod for info? Probably a stupid question, but when I press forward (right click?) on the ipod it just starts playing the next song...

    The "right click" refers to using the mouse on a song displayed in either the iTunes library or the iPod song list in iTunes when it's connected to your PC. It doesn't mean click on the right side of the click wheel.

  • How to make folders in photo?

    How to make folders in the photo app pre-loaded on the IPad?

    Whne you are in the screen where you can select which Album to view, there should be an Edit button top right of the screen - tap that and then tap the New Album button that will then show top left and name your new album. You will then be shown thumbnails of your photos so that you can 'copy' those photos into that new album.
    From what I understand with how it works, those photos won't be moved into the new album, instead they will remain in the original album and a pointer to them will go in the new album - so if you then delete the photo from its original album it will also be removed from all new albums that you've 'copied' it into.

  • How to create folders for SMS in iPhone 4?

    Hi,
    How to create folders for SMS in iPhone 4?
    Is there a way to create folders for SMSs in iPhone 4?
    Thanks & regards,
    Afreen

    sorry about that..Where do i find the replies to my posts?  tks

Maybe you are looking for

  • Purchase order is not displayed in the t.code ME23N

    Hi All, While seeing t.code -ME23N purchase order display got the error message 'Address doesn't exist 587354 Message no. AM010 I have checked table level -adrc the number 587354 is dsiplayed. If anybody know the reason please revert the same. Thanks

  • Execution of code in an improper schema

    We are running 10.2.0.4 Oracle database on Sun Solaris. Due to the nature of this question, I am inclined to place it here under 'Database - General' section rather than the SQL/PLSQL section. Our development database say DEV1 has 4 schemas - SCHEMA1

  • Am I able to use more than 1 audio file in IDVD?

    Am I able to use more than 1 audio file in my IDVD project? I want to have different songs in my subtitles.

  • DVI to HMDI - how to make it look better?

    I am hooking up my MBP to a Sony 46" Bravia Z LCD through the HMDI connection - how can you make the external LCD look a little bit better? Seems the MBP picks up the signal and recognizes the Sony screen - but the colors don't look like my MBP scree

  • My apple ID no work in my phone

    I have iphone4/8gb I just bought 5 months! currently my iphone can not be used as an iphone i did restat automatically and I use apple id can not be used to activate! I've  been trying to reset apple id to the center but there is no solution  and now