[JS] Can I get Children Folders of a folder ?

Hi,
Meanwhile there is a Folder.getFiles() command, I didn't find any Folder.getFolders() or Folder.folders or Folder.children in the ESTK DOM.
The only way I see is to write this specific operation both in VB and AS and call them via a doScript depending on the system.
But before doing this, I would like to be sure JS couldn't help me.
Thanks for advices.
Loic

Hi Loic,
Here is how I solved this in my 'Place images script' — http://kasyan.ho.com.ua/place_images.html
// global variable (empty array)
var mySubFolders = [];
// myStartFolder is the folder from which to start collecting subfolders
mySubFolders = getSubFolders(myStartFolder);
function getSubFolders(theFolder) {
      var myFileList = theFolder.getFiles();
      for (var i = 0; i < myFileList.length; i++) {
            var myFile = myFileList[i];
            if (myFile instanceof Folder){
                  mySubFolders.push(myFile.absoluteURI);
                  getSubFolders(myFile);
      return mySubFolders;
Hope this helps.
Kasyan

Similar Messages

  • Can I get rid of the Adobe folder(s) on my Desktop after installing or updating?

    Can I get rid of the Adobe folder(s) on my Desktop after installing or updating?

    Hello,
    Yes, you can delete it.
    But, the Adobe folder you want to remove is actually the setup for Acrobat. So, you might save it at some other location so that if in future you need to re-install the software, there is no need to download the entire product.
    Regards,
    Anubha

  • How can i get the path to config folder placed inside the jar file?

    Hi i have developed an RCP application using eclipse.
    In my application config directory is there.
    When i export my RCP application as JNLP Project the jar file is created which contains config folder inside it.
    When i download the application using java web start , how can i get the path to config folder placed inside the jar file?
    Will the config folder exists in local cache in my system?
    Help needed.
    -Deepak

    -- This works in CS6:
    tell application "Adobe InDesign CS6"
      set myDocument to active document
      set selectedRectangles to selection of myDocument
      set theGraphicsLink to file path of item link of (graphic 1 of (item 1 of selectedRectangles))
    --> "Macintosh HD:folder/folder/filename.tif"
    end tell

  • HT4221 I arranged my photos in order on my PC and when I synced them to my ipad they appeared in a completely different order. How can I get my folders to transfer exactly how they are on my PC?

    I arranged my photos in order and in folders on my PC. When I synced them to my IPad they were in the correct folders but completely out of order. How can I get them to sync in the order they appear on my PC?.

    On iOS 5 (if viewing individual photo albums on the iPad) the photo sorting order should be by filename, on iOS 4 it's date taken (from here) :
    iOS 4 sorts photos by the Date Taken tag of the photos. Specifically, your device uses the pictures' EXIF tags to determine the Date Taken information. Your device will look for the following EXIF tags within your pictures:
    Capture Date
    Date Time Digitized
    Date Time Original
    Last Modified
    So you will need to change their names or their dates

  • Can't get mail folders from IMAP server, why?

    I set up my IMAP mail server, but i only see the inbox and not the other mail folders in the in the mail server.
    why can i get my other mail folders from ther server?
    Ram

    Allan - Here's the other odd thing. Currently, I have my old mail account AND my new MM account both feeding into and out of Outlook. But since adding my MM acct. - even though I set it as my default mail acct. - the hierarchy tree of Outlook folders is still treating my old acct. as king and my new MM acct. as second class. I know, what's that mean? I have my overriding "Personal Folders" folder, with the sub-folders (in addition to customized ones I added) - all of these at the same level - 'Deleted Items'; 'Inbox' (for my old account); 'Junk E-mail'; 'RSS Feeds'; 'Sent Items' and "Search Folders". Then, below that, but at the same hierarchy level as "Personal Folders", I have my MM's root of an IMAP store folder that has as its name my email address, including the "@me.com". Under that, at the same level of importance as my 'Deleted Items', etc. for my old account is my MM account's "Inbox", "Junk E-mail", "Sent" (which, like I said, I created when I sent the first email from my newly created MM account), and "Search Folders"... that's it. If I delete an email from my MM acct., or am in the process of creating an email in my MM acct., I can only find it in the aforementioned "Deleted Items" or "Draft" folders, as my MM acct. doesn't have these. Is this perhaps one indicator of my sent mail synching problem? Or does one have nothing to do with the other? Does Outlook only provide one each of "Drafts", "Deleted Items" and "Outbox" that all accounts share?

  • Can't get a comparison between a folder name and a string to work

    Dear community,
    I have a really simple ExtendScript-example that I just can't get to work and I have no idea what could be wrong. I'm trying to write a script that goes through all the items in the project panel and stores references to all the folders which names are like "layer1", "layer2", and so on, in an array. This is the code that should alert 3 times in my case, but it doesn't alert once..
    for (var i=1; i<=app.project.numItems; i++)
        if ((app.project.item(i) instanceof FolderItem) && (app.project.item(i).name == "layer"+i))
            alert("found folder = " + app.project.item(i).name);
    Inside the project in the root-directory there are 2 comps and 3 folders named 'layer1', 'layer2' and 'layer3' - so I should see 3 alerts when executing the above script. For testing-purposes I changed the second part of the if-statement to a 'static' value like so:
    .. && (app.project.item(i).name == "layer1"))  --> then it works! But I need a dynamic solution..
    Thanks very much for ANY help in advance!
    Greetings,
    Gilbert

    I just tried the code and it only alerted once for me. The issue with your code is that it requires the "Layer" named folders to always be the first x items in the project file. So what is happening for you is that...
    If any item appears before the first "Layer" folder then you are effectively comparing random names to each other that will never match.
    ItemSomethingElse
    RandomFolder                 == Layer1     (false)
    Layer1                              == Layer2     (false)
    Layer2                              == Layer3     (false)
    Layer3                              == Layer4     (false)
    Layer4                              == Layer5     (false)
    ItemSomethingElse
    What you need to do to keep it dynamic:
    1) Gather instances of all the folders in your project into an array.
    2) Loop through that array checking for indexOf "Layer".
    3) If there is a match...
    4) Compare that name in another loop. You'll have to determine the max number to loop through for your search, like 25 or 50 or something that won't loop forever.
    5) If a Layer# match is found then run your alert.
    ItemSomethingElse
    RandomFolder                 indexOf("Layer")     (false, do not add)
    Layer1                              indexOf("Layer")     (true, add instance to folderArray)
    Layer2                              indexOf("Layer")     (true, add instance to folderArray)
    Layer3                              indexOf("Layer")     (true, add instance to folderArray)
    Layer4                              indexOf("Layer")     (true, add instance to folderArray)
    ItemSomethingElse
    So something like this should work:
    var folderArray = new Array();
    //Loop through project grabbing folders with layer in the name
    for (var i=1; i<=app.project.numItems; i++){
         var curItem = app.project.item(i);
         if(curItem instanceof FolderItem && curItem.name.indexOf("layer") != (-1)){
              folderArray[folderArray.length] = curItem;
    //Set cap for number appended to "layer"
    var cap = 25;
    var curName;
    var folderArrayLength = folderArray.length;
    //Loop through new "layer" array
    for(var l=0; l<folderArrayLength; l++){
         for(var c=1; c<cap; c++){
              //Dynamic name
              curName = "layer"+c.toString();
              //Current folder name
              folderName = folderArray[l].name;
              //Compare them, alert if the match
              if(folderName == curName){
                   alert("found folder = " + folderArray[l].name);
                   break;//End comparison once found

  • PSCS3 Mac: Can't get Applescript to open "desktop:folder:file.jpg"

    I have Photoshop CS3 and am scripting a lengthy workflow, and part of it requires that I get Metadata out of files using Photoshop.
    I can not get Photoshop to open a file. Once I have the file open, I can get the metadata out using UI scripting, but I have tried numerous approaches to open files and it has me stumped.
    I am making it as a function that I can call from the main script which compares a new list of files with a list that is a few minutes old to determine which files are new and repeats with each file in the list. So the function will be getting a file name or a path.
    Any help would be greatly appreciated!
    Brian

    I got it! It needs to be an alias class path, and I had to concatenate the path incrementally before finally the whole path is in one variable I could coerce into an alias.
    Of course, this is just one segment of the whole workflow.
    tell application "Finder"
    activate
    set fileList to name of (items of folder "to gallery" of desktop)
    repeat
    set newFileList to name of (items of folder "to gallery" of desktop)
    if length of newFileList > 0 then
    repeat with thisFile in newFileList
    if thisFile is in fileList then
    else
    my PSInfoGalAdd(thisFile)
    end if
    end repeat
    set fileList to newFileList
    end if
    delay 30 --This will eventually be 4 minutes
    end repeat
    end tell
    on PSInfoGalAdd(thisFile)
    tell application "Adobe Photoshop CS3"
    activate
    set desktopPath to path to desktop
    set toGalPath to desktopPath & "to gallery:" as string
    set wholePath to toGalPath & thisFile
    set openIt to wholePath as alias
    open openIt
    tell application "System Events"
    tell process "Adobe Photoshop CS3"
    key code 34 using {command down, option down, shift down} --File info window
    delay 4
    repeat 12 times
    key code 125 --down arrow to Origin
    delay 0.2
    end repeat
    repeat 5 times
    key code 48 --tab to credit
    delay 0.2
    end repeat
    key code 8 using command down --copy
    delay 0.3
    set credit to the clipboard
    repeat 3 times
    key code 48 --tab to instructions
    delay 0.2
    end repeat
    key code 0 using command down --select all
    delay 0.3
    key code 8 using command down --copy
    delay 0.3
    set headline to the clipboard
    key code 48 --tab to transmission reference
    key code 0 using command down --select all
    delay 0.3
    key code 8 using command down --copy
    delay 0.3
    set body to the clipboard
    key code 48 --tab
    key code 36 --return key to dismiss info window
    end tell
    end tell
    end tell
    end PSInfoGalAdd

  • I have two podcast folders. I can't delete and redownload the old ones because they are not available any more. How can I get them into the new folder?

    The problem of having 2 'Podcast' folders / menu items after adding a new podcast through clicking on a link in the browser has been addressed on the forums by instructing users to resubscribe to existing podcasts, which then appear in the new folder, and delete the old folder.  This will not work for me as most of the podcasts I listen to are BBC, which vanish from the web 7 days after they were first broadcast (about which much swearing, but that's unalterable).  Consequently I can't adopt this solution.
    I have resubscribed to the podcasts using the link in a browser method, so that they all appear and (in theory) will download new episodes again. However, this leaves the old episodes missing. What must I do to get the episodes downloaded from the old podcasts recognised as belonging to the new subscriptions?

    I found a very fast and easy solution: I selected all the podcasts in the first window, copied them using the command in the Menu>Edit (Command+C did not seem to work). I then pasted them into the new empty folder. All the podcasts already downloaded appeared. The only problem is that some podcasts did not remember which had been viewed or not, while did keep the information. I just had to re-subscribe to the ones I still wanted by clicking on button.
    For some reason, the previous Podcasts folder was only recogized as a list by iTunes, this showed up when I deleted the previous folder (contextual menu). I also had to re-select which ones I wanted synced with my iPad and iPhone.
    (I did make a backup of the Podcasts folder in the Finder, just in case, a bit like voodoo computing)

  • I can sync bookmarks on my Firfox for android, but folders aren't sync, i can only get bookmarks from bookmarks main folder. Is a bug or a config issue?

    I can sync bookmarks in firefox for android, but only the ones that are on Bookmarks main folder, the folders create below the main folder are not synchronized. Is this a bug or a config issue?
    Thanks

    Thanks Barney, I tried that but all that comes up in Spotlight are the log files that show the file paths! I don't know how Steam works. Are all the files held by Steam on their server perhaps?

  • Can't get into folders in other apps for finder

    White using mail or photoshop or safari or any other program, when I try to open a file or save a file in a certain folder I cant get into anything. The directories are there but I cant click into them. This is super annoying cause everything i wanna open a file in photoshop i gotta open up finder first then drag and drop into photoshop instead of just openning the files straight from photoshop (this is the same for pages and itunes and other mac programs)

    It's possible that something glitched during the upgrade.
    When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.
    (1) Bypass Firefox's Cache
    Use Ctrl+Shift+r to reload the page fresh from the server.
    Alternately, you also can clear Firefox's cache completely using:
    orange Firefox button (or Tools menu) > Options > Advanced
    On the Network mini-tab > Cached Web Content : "Clear Now"
    If you have a large hard drive, this might take a few minutes.
    (2) Remove the site's cookies (save any pending work first). While viewing a page on the site, try either:
    * right-click and choose View Page Info > Security > "View Cookies"
    * Tools menu > Page Info > Security > "View Cookies"
    In the dialog that opens, you can remove the site's cookies individually.
    Then try reloading the page. Does that help?

  • Can not get local folders menu to show

    win 8.1 thunderbird 31. All normal except cannot access "Local Folders" menu that is on left side of screen on other XP computer.
    In fact can not find "Sent" which is what i really want.
    Thanks.
    jim

    Do you even have a folder Pane on the left side?
    If not, turn it on.
    '''View-Layout-Folder Pane'''
    If Folder Pane is checked and not showing, you have pushed it off the side of the screen.
    Move your mouse to the left screen margin and watch for the cursor to change to a double headed arrow. When it does, left click, hold and drag to the right to uncover the Folder Pane.

  • I am trying to download photos stored on a memory stick to my imac, but two of the files are saying unreadable.  Why?  Are these two sets of photos never going to be copied onto my Mac?  If so, how can I get them onto my iphoto folder.  Desperate.  Glen

    I am trying to put photos stored in a memory stick onto my Mac computer.  But there are two folders that will not move.  I get an error message saying - volumes/FLASH DRIVE/desktop. ini - can someone help me please?  The photos are from my windows computer.  Please answer back assuming I am a total drip - I am a lot older than you I should imagine !!  Thanks  Glenys

    Can you double click on them on the memory stick, see if preview opens them, then save them to your Mac?
    ...JER

  • Can I get the Trash and Send folder in IMAP

    Hi,
    I work now for a mail aplication using IMAP. I connect to Microsoft Exchange Server and my question is if there is a posibility to find which folder is the TRASH and which one is the SEND folder. The idea is that I can not use the name because I don't know which IMAP server the users will use (I mean the server can be in different languages and then the folders will have different names).
    Thanks in advance,
    Catalin Tileaga

    One thing you can consider if you're using Exchange 2000 is to use the WebDAV protocol for accessing the server. If you're using Exchange 5.5 you might consider using CDO. Both protocols would allow you to get the real name of the Trash and Sent folders programmatically so that you don't have to rely on a hardcoded name. See the link below for more information...
    Skip O'Grudnick
    http://www.compoze.com/

  • Can't surf my folders using 'skip folder' on a Zen Nano P

    . So frustrating! Please advise.

    Hi!
    Are there any updates on this issue? Obviously, I'm facing the same here.
    I have three folders (Misc/New/Soundtrack) with no subfolders at all.
    All three folders are shown while using the Windows Explorer - however, when using the Nano Plus, only "New" and "Soundtrack" can be choosen. The "Misc" folder disappears then.
    Thanks for any help!
    Regards,
    Hauserbub

  • HELP!!! Can I get back files from a folder that has been copied over?

    I had a file in the trash with the same name as a file on my desktop. I accidentally started copying it from the trash to my desktop. It erased some of the files I had on my desktop in that folder that were very important, before I could stop it from copying. Is there any way to get the files back? They had been on my desktop for a few months. I'm thinking that maybe they are stored somewhere on the computer. I tried a search but came up with nothing. I usually back up to a external hard drive but I didn't this time and I'm paying for it now!

    When a file is erased, the space on the drive that the data occupies is not necessarily erased. It is just unallocated, so that other new data can use it. However, until that new data overwrites that same physical space on the drive, your old data may still be recoverable.
    To do this, you need to use a data recovery tool. There are tools that specialize in data recovery, such as
    http://www.prosofteng.com/products/data_rescue.php
    and other tools have a have multiple functions, including data recovery
    http://www.micromat.com/index.php?option=com_content&task=view&id=202&Itemid=107
    If you want to try recovering the data using such a tool, you should stop using the Mac (or use it as little as possible). Any use of the Mac will make it more likely that the space occupied by the old data will be overwritten. If that happens, the portion that is overwritten will not be recoverable.
    This is a good example of when Time Machine (part of Leopard and Snow Leopard) would be extremely helpful. It does backups to an external drive automatically, in the background, once per hour that the Mac is active. You just set it up and then forget about it. You can get any file back that you accidentally erase, even an older version of it.

Maybe you are looking for

  • Java.lang.nullpointerexception found while invoking services

    Hi, I am getting java.lang.nullpointerexception while invoking a simple web service(Hello World) from another service from BPEL.Soa suite 11.1.1.5 is used .The service1 WSDL reference is taken from the em console test page and bult a web service in c

  • Default signature issues with Mac Mail

    All my emails persist with a default signature even when I change email addresses with single associated signatures. It merely keeps the first signature and tacks on the selected signature. I have removed all signatures and started again, assigning s

  • Is it possible to extend two classes?

    I want to do something like : public class C extends A, B { public class E extends A, D { }The two classes have things in A in common, but have to extend other different classes (B, D) as there are other differences.

  • Check whether a transaction is running

    I need to know if there is a function I can use to check whether a transaction is being run by a specific user.

  • Not able to connect to base station after last security update

    Since the lastest update came out, I am no longer able to connect to the same base station I was once able to connect to. I get my DSL through SBC, and the station is a 2Wire Gateway. My mac mini still is able to connect, since it didn't have the sec