open documents (or files) in the subfolders of the folder of my target

Hi guys,.

I'm new to javascript and I need help to open documents in subfolders of the folder of my target. There are several subfolders (subfolder 1 to 10 for example) contained in a folder ("Folder" in the script below). I want to open all the documents in a subfolder at a time and do something for these documents. Then close and open documents in a different subfolder (loop).

I find a way to open documents that are directly under a folder. The problem is that I don't know how to open a document in the subfolder of a folder

I need code that could do something like "getfolders" (but there is no such thing as 'getfolders') to the subfolder of 1 to 10 the number and loop through them to open documents.

Could some please help me with the problem?

This is where I am so far:

#target photoshop

Var folder = Folder.selectDialog ("select folder");

If {(Folder)

Uses of the var = theFolder.getFiles (/ \.) (jpg) | TIF | EPS | (psd) / $i);

for (var m = 0; m < theFiles.length; m ++)

{

Open all documents in the folder

var idOpn = charIDToTypeID ('Opn');

var desc52 = new ActionDescriptor();

var idnull = charIDToTypeID ("null");

desc52.putPath (idnull, theFiles [m]);

var ADI is charIDToTypeID ("As");.

var idTIFF = charIDToTypeID ("TIFF");

desc52.putClass (Adis, idTIFF);

executeAction (idOpn, desc52, DialogModes.NO);

... do something for documents

... Save and close

}

}

I finally get the correct script by combining small pieces from here and elsewhere

After selecting the top folder, this script will go through each subfolder, one to a tim.e to open two files tif - that contain respectively the cy5 and texas. Then the script will superimpose the cy5 texas file file in a new RBG file and save it with a similar name that the file of texas except the overlay file will replace Texasred with overlay:

#target photoshop

app.bringToFront ();

main(); call the main function

main() {} function

records of var = [];

var topLevel = Folder.selectDialog("");  Select the superior folder

if(topLevel == null) return; If you cancel to quit smoking

records = FindAllFolders (topLevel, records);  call the FindAllFolders function

Folders.unshift (topLevel);  Add new items at the beginning of an array

for (var z = 0; z)< folders.length;="" z++){//="" loop="" through="" all="">

List of files of the var = folders [z] .getFiles ("*.tif"); a list of all the hair in this subfolder

for (var a = 0;< filelist.length;="" a+="">

{//loop through all the files in the folder; 2 at a time

If (fileList[a].name.match(/cy5/i)) {/ / the file must contain cy5}

DocRef var = app.open (fileList [a])}; Open file

If (fileList[a+1].name.match(/texas/i)) {/ / the file must contain Texas}

var docref1 = app.open (fileList [a + 1]);} Open file

* insert ' final script any overlay ", recorded by scriptistener

Marker - Sep 17, 2016, 18:21:49

// start=======================================================

create a new custom RGB

var idMk = charIDToTypeID ("Mk");

var desc136 = new ActionDescriptor();

var idNw = charIDToTypeID ('Nw');

var desc137 = new ActionDescriptor();

TSM var = charIDToTypeID ("Md");

var idRGBM = charIDToTypeID ("RGBM");

desc137.putClass (TSM, idRGBM);

var idWdth = charIDToTypeID ("Wdth");

var idRlt = charIDToTypeID ("#Rlt");

desc137.putUnitDouble (idWdth, idRlt, 665.760000);

var idHght = charIDToTypeID ("Hght");

var idRlt = charIDToTypeID ("#Rlt");

desc137.putUnitDouble (idHght, idRlt, 498.720000);

var idRslt = charIDToTypeID ("Rslt");

var idRsl = charIDToTypeID ("#Rsl");

desc137.putUnitDouble (idRslt, idRsl, 150.000000);

var idpixelScaleFactor = stringIDToTypeID ("pixelScaleFactor");

desc137.putDouble (idpixelScaleFactor, 1.000000);

idFl var = charIDToTypeID ("Fl");

idFl var = charIDToTypeID ("Fl");

var idBckC = charIDToTypeID ("BckC");

desc137.putEnumerated (idFl, idFl, idBckC);

var idDpth = charIDToTypeID ("Dpth");

desc137.putInteger (idDpth, 16);

var idprofile = stringIDToTypeID ('profile');

desc137.putString (idprofile, "sRGB IEC61966 - 2.1");

var idDcmn = charIDToTypeID ("Dcmn");

desc136.putObject (idNw, idDcmn, desc137);

executeAction (idMk, desc136, DialogModes.NO);

end of the new creation of file marker - Sep 17, 2016, 18:22:19

// start=======================================================

perform the action for recovery

var idPly = charIDToTypeID ('folds');

var desc138 = new ActionDescriptor();

var idnull = charIDToTypeID ("null");

var ref90 = new ActionReference();

var idActn = charIDToTypeID ('Actn');

ref90.putName (idActn, "Overlay");

var idASet = charIDToTypeID ("ASet");

ref90.putName (idASet, "Default Actions");

desc138.putReference (idnull, ref90);

executeAction (idPly, desc138, DialogModes.NO);

end overlay action marker - Sep 17, 2016, 18:24:08

// start=======================================================

Save the overlay file

var idsave is charIDToTypeID ('save');.

var desc139 = new ActionDescriptor();

var ADI is charIDToTypeID ("As");.

var desc140 = new ActionDescriptor();

var idBytO = charIDToTypeID ("selonPour");

var idPltf = charIDToTypeID ("Pltf");

var idMcnt = charIDToTypeID ("Mcnt");

desc140.putEnumerated (idBytO, idPltf, idMcnt);

var idTIFF = charIDToTypeID ("TIFF");

desc139.putObject (Adis, idTIFF, desc140);

Marie Salomé var is charIDToTypeID ('In');.

var name = list of files [a + 1].name.replace ("Texasred", "Overlay"); Rename the new file to overlay RGB

desc139.putPath (Marie-Salomé, new file (files [z] + ' / ' + name));

var idLwCs = charIDToTypeID ("LGD");

desc139.putBoolean (idLwCs, true);

executeAction (idsave, desc139, DialogModes.NO);

end of file save marker - Sep 17, 2016, 18:26:43

// start =======================================================

Close all files

var idCls = charIDToTypeID ("Cls");

executeAction (idCls, undefined, DialogModes.NO);

// =======================================================

var idCls = charIDToTypeID ("Cls");

executeAction (idCls, undefined, DialogModes.NO);

// =======================================================

var idCls = charIDToTypeID ("Cls");

executeAction (idCls, undefined, DialogModes.NO);

end of file closing marker - Sep 17, 2016, 18:27:43

* end of the insertion of the script of any final overlay

} //end filelist loop

} //end loop of subfolders

} //end main function

function FindAllFolders (srcFolderStr, destArray) {}

var fileFolderArray =. getFiles() folder (srcFolderStr);

for (var i = 0; i)< filefolderarray.length;="" i++="" )="">

var fileFoldObj = fileFolderArray [i];

If (fileFoldObj instanceof File) {}

} else {}

destArray.push (Folder (fileFoldObj));  Add new items at the end of a table

FindAllFolders (fileFoldObj.toString (), destArray);

}

}

Return destArray;

}

Tags: Photoshop

Similar Questions

  • I can't open the files in the folder "my pictures."

    For the last two weeks, I was unable to open the files in the folder "my pictures." For example, if I save the photo in my pictures, it will not open if I double click on it.
    Someone at - it ideas?
    Thanks in advance.

    Hello Tim

    Is there a message if you want to open it? You can copy data to another folder in my photos and open them?

    You have this problem just with images or even other files?
    Give us more information.

  • "Sorry, Move Maker cannot open this project file. The file is not compatible with Windows Live Movie Maker or damaged. Please select a different project file. »

    Hello!
    I installed Win Live Movie Maker, but when I tried to open my .mswmm file I only got this message: "sorry, Move Maker cannot open this project file. The file is not compatible with Windows Live Movie Maker or damaged. Please select a different project file. "The file will open correctly in Windows Live Movie Maker 7, so everything should be OK. What I am doing wrong?

    Hello

    This is supported in Windows Live movie maker file type.

    http://help.live.com/help.aspx?project=wl_movie_makerv1&market=en-IE&querytype=topic&query=wl_movie_maker_ref_supportedfiles.htm

    For any request or problems related to Windows Live Movie maker, please post to the Windows Live Help forum.

    Here is the link: http://www.windowslivehelp.com/product.aspx?productid=5

    Diana

    Microsoft Answers Support Engineer

    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Open a PDF file inside the ZIP with the preview pane

    Windows x 64 10 / Acrobat Reader XI

    My problem: I have a ZIP file with the PDF files. I opened the ZIP file with Explorer Windows and "preview pane". I click on a PDF file-> the display of the PDF file preview pane-> NO problem. When I click on the PDF file to open it in Acrobat I get the message:

    I found out why: when you click on the PDF Windows files a copy extracted in % temp % and when you double-click the file Windows want to recreate the same file in the directory %Temp%.

    How to open this PDF file without the file?

    Hi christianc77510099,

    Please, copy the PDF file of the Zip folder and paste it on your desktop.

    Now try to open it with the Acrobat application.

    Let us know if the problem persists.

    Kind regards
    Nicos

  • Cannot open a pdf file from the website of immigration canada. Gets a message - you need a later version of the same player after update still not working

    Cannot open a pdf file from the website of immigration canada. Gets a message - you need a later version of the same player after update still not working

    10 Windows Internet Explorer with the Acrobat Reader plugin is available.

  • Disable the opening of PDF files in the browser.

    Hi guys,.

    I'm deploying DC to my environment, but only one requirement is disable the opening of PDF files in I.e.

    The only work to date is to * manually * disable the Adobe PDF Reader add-on in IE11.

    I tried:

    1. GPO to disable Adobe PDF Reader. The add-on comes as disabled, but a PDF file will always open in IE.

    2. the HKCU entry for bBrowserIntegration = 0. It makes no difference.

    The second step is the only one I've ever used for reader XI and it satisfied my needs. Someone at - it run in this yet? It's really weird that manually disabling the addon works (all PDFs pop out of drive) but if I re - enable and disable then via GPO, the opening of PDF files in the browser.

    Hi christopherh31260325,

    Please provide detailed information about your question.

    Could you please try to uninstall and reinstall MS Reader from the link mentioned below:

    Adobe Acrobat Reader DC install for all versions

    Then, try to disable the opening of PDF files in the browser after you follow the instructions as indicated in the link of doc KB:

    Reference: Acrobat Help. Display PDF in browser. DC to Acrobat, Acrobat Reader DC

    Let me know if it helps.

    Kind regards

    Ana Maria

  • Just had help installation cc 2014. get this dialog box when I open the app. One or more files in the folder required for the operation of photoshop adobe are missing. Help

    Just had help installation cc 2014. get this dialog box when I open the app. One or more files in the folder required for the operation of photoshop adobe are missing. Help

    Run the cleanup tool to remove Ps CC 2014:http://www.adobe.com/support/contact/cscleanertool.html .

    Restart the computer and then try to reinstall Ps CC 2014.

    Kind regards

    Ashutosh

  • How to open a psdx file in the new photoshop?

    How to open a psdx file in the new photoshop?

    Hey o Studio,

    Pleas see the following forum thread on how to open the PSDX file in Photoshop.

    http://forums.Adobe.com/message/4929353#4929353

    I hope this helps.

    Kind regards

    Sumit Singh

  • File to open a pdf file using the links in action

    Hi all

    I am trying to open a pdf file that resides in the following location (/ bishiphome/Middleware/Oracle_BI1/bifoundation/web/app/Hlo/l_en).
    I chose this place just to be sure, there is no access right problem.
    I am able to open any file residing in that folder html by using an action link (URL: http://IPADDRESS:PORT/analytics/olh/l_en/biee0001.htm), but once I try with a pdf http://IPADDRESS:PORT/analytics/olh/l_en/Test.pdf file I get the following error:
    Error 404 - not found
    RFC 2068 Hypertext Transfer Protocol--HTTP / 1.1:
    10.4.5 404 not found
    Server has not found anything matching the request URI
    PS: when I copied the pdf file in the folder that I restarted weblogic.

    Any idea guys?

    Concerning
    Adil

    Hi Adil,

    Place the PDF in /l_en dint record works for me too however, you can place them inside the following paths and restart the services.

    D:\MWARE\user_projects\domains\bifoundation_domain\servers\AdminServer\tmp\_WL_user\analytics_11.1.1\silp1v\war\res

    AND

    D:\MWARE\Oracle_BI1\bifoundation\web\app\res

    You can then call your file with the url http://hostname:port/analytics/res/filename.pdf

    It worked for me, let me know in case of any problems.

    Rgds,
    DpKa

  • Music watch 65.4 GB files folder but no files in the folder

    I bought a 1 to Digistore external hard drive - a few years ago, and I used it to store all my media since: photos, videos, music and e-books. My main reason to have the external hard drive is to simplify the process of moving these files and make sure they are more protected. I recently got a new laptop which runs on Windows 7, but also a new iPod touch. So as I got the computer a little longer, I already transferred my purchases and others from my old iPod to my new computer, and all my music to fit on the iPod 32 GB, I had to choose the option "Convert higher than 256 Kbps rate songs" in iTunes. If all transferred files were 256 Kbps. So I plug in my hard drive to your new PC and "Scan [ed] and difficulty [ed]" (which lasted 5 hours). So I decided to check the files in Windows Explorer, manually before I imported the iTunes (I also had major duplication problems, which doubled my bytes in iTunes). I discovered that all my files are intact and my photos, videos and e-books are all there, but none of my music is in the "Music" file on my hard drive, except for the 2 files that were not in subfolders. I then check 'Properties' to the 'Music' file and there 65.4 Go in the folder, but the records are all empty... I lost in the initial transfer to iPod music, but I really need the original quality of the files on my hard drive, as I'm a bit of a purest, I guess. I've referenced the other topics on this site, but they do not mention external drives and pressing Alt + T > Folder Options > view > show hidden files and folders did not work for me either. As far as I know, this new computer (second-hand) had no viruses, and files were able to see on my laptop XP before I plugged on the Windows 7 laptop, but now, say something to the effect of "No files in the folder" when you open the sub folders. I am seriously distressed my what, as music is a majority of my life, and I know that the files are not lost, if they still 65 GB of disk space. Could someone give me please a solution that works? Also, I noticed that when I eject my XP laptop hard drive, the light on it turns off and I can feel the drive stop its process, but when I eject on the new Windows 7 laptop, the PC says 'remove mass storage device Safe,' but the light stays on and functions still drive. I understand that this can be a huge problem, but once the device is ejected, I can't access to more info on this subject, and even when I looked to find the "Stop generic-mass" option in Windows 7, I couldn't. It seems to me that while Windows 7 has a friendlier user interface, missing some functions altogether, or complicate otherwise simple used to be things to do.

    "Make active"... There is no available disk-levelaction.  What you mean is "Mark Partition as Active".  Is not what you or the other poster may think it is, it does not have a disk "available or unavailable", that is applied to the partition level and what is the MBR to say which partition to boot when he takes control of the boot process.  In other words, the Master Boot Record has some code telling him that it loads the boot sector of the active partition, that's all.

    Not necessarily any active partition on the disk at all, often data discs do not have an active partition, active partitions are only necessary at the start of the operating systems, otherwise there is no need to have an active partition and does not mean a hill of beans in the ability to use the disc to store data.

    There can only be one active partition on a disk given at any time, if a partition is already marked as active and if you select this option to mark another partition on the same disk as active the active indicator will be removed from the active partition and the other partition will be marked as active, the active indicator will be "switched" between the partitions.  If you remove the indicator active partition used to boot your Windows installation then MBR won't be able to start Windows, and it will give you an error message indicating that he could not find an operating system to load or the boot loader is missing.

    John

  • Script commands on several files in the folder

    Hello

    I am very new to JavaScript and I combinded a few codes that I found here to build a swatch color replacement tool. It works very well! The only issue I'm having is that it only works on a single file in the selected folder. I would like that it works on all files in the folder. Am I missing a loop function? Any help much appreciated. Thank you.

    Main code [the script starts here]

    Uncomment to delete the Illustrator warning dialog boxes

    app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

    var destFolder sourceFolder, files, type sourceDoc file, targetFile, pdfSaveOpts;

    Select the source folder.

    sourceFolder = Folder.selectDialog ("select the folder with the Illustrator");

    If a valid file is selected

    If (sourceFolder! = null)

    {

    files = new Array();

    fileType = prompt ("select the type of Illustrator files you want to process.") For example: * .ai ',' ');

    Download all the files that match the pattern

    files = sourceFolder.getFiles (file type);

    If (files.length > 0)

    {

    Get the destination to save files

    destFolder = Folder.selectDialog ('Select the folder where you want to save the files.', ' ~');

    destFolder = sourceFolder;

    for (i = 0; i < files.length; i ++)

    {

    sourceDoc = app.open (files [i]); Returns the document object

    App.Paste)

    App.Cut)

    var docRef = sourceDoc;

    with (docRef) {}

    var replaceColor1 = swatches.getByName('YELLOW_Final').color;

    for (var i = 0; i < pathItems.length; i ++) {}

    with (pathItems [i]) {}

    If (filled == true & & instanceof SpotColor fillColor) {}

    If (fillColor.spot.name == 'Yellow TEMP') fillColor = replaceColor1;

    }

    If (stroked == true & & strokeColor instanceof SpotColor) {}

    If (strokeColor.spot.name == 'Yellow TEMP') strokeColor = replaceColor1;

    }

    }

    }

    for (var j = 0; j < stories.length; j ++) {}

    with (stories [j]) {}

    for (var k = 0; k < characters.length; k ++) {}

    with (characters [k] .characterAttributes) {}

    If (instanceof SpotColor fillColor) {}

    If (fillColor.spot.name == 'Yellow TEMP') fillColor = replaceColor1;

    }

    If (instanceof SpotColor strokeColor) {}

    If (strokeColor.spot.name == 'Yellow TEMP') strokeColor = replaceColor1;

    }

    }

    }

    }

    }

    }

    sourceDoc.save ();

    sourceDoc.close ();

    }

    }

    }

    on the other

    {

    Alert ("no file found");

    }

    ZINGERERs wrote:

    -J' I combinded some codes I found here

    You should always reference it these discussions/messages/links, so that we can see the code of original work before tinkering it upward with the changes. I think that its the following thread:

    Muppet Mark Code: http://forums.adobe.com/message/2570586

    ZINGERERs wrote:

    The only issue I'm having is that it only works on a single file in the selected folder. I would like that it works on all files in the folder.

    It works in my test (I did a few test files) and used code marks in some batch code I use. Give it a try, works very well in my tests.

    app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
    var filesFolder = Folder.selectDialog('Select the folder where the (.ai) files are located.', '~');
    if (filesFolder != null) {
        var filesArray = new Array();
        filesArray = filesFolder.getFiles("*.ai");
        if (filesArray.length > 0) {
            var saveToFolder = filesFolder;
            var curDoc;
            for (var f = 0, l = filesArray.length; f < l; f++) {
                curDoc = app.open(filesArray[f]);
                // ------------------------------
                // Muppet Mark Code:
                // Thread: http://forums.adobe.com/message/2570586
                with(curDoc) {
                    var replaceColor = swatches.getByName('YELLOW Final').color;
                    for (var i = 0; i < pathItems.length; i++) {
                        with(pathItems[i]) {
                            if (filled == true && fillColor instanceof SpotColor) {
                                if (fillColor.spot.name == 'Yellow TEMP') fillColor = replaceColor;
                            }
                            if (stroked == true && strokeColor instanceof SpotColor) {
                                if (strokeColor.spot.name == 'Yellow TEMP') strokeColor = replaceColor;
                            }
                        }
                    }
                    for (var j = 0; j < stories.length; j++) {
                        with(stories[j]) {
                            for (var k = 0; k < characters.length; k++) {
                                with(characters[k].characterAttributes) {
                                    if (fillColor instanceof SpotColor) {
                                        if (fillColor.spot.name == 'Yellow TEMP') fillColor = replaceColor;
                                    }
                                    if (strokeColor instanceof SpotColor) {
                                        if (strokeColor.spot.name == 'Yellow TEMP') strokeColor = replaceColor;
                                    }
                                }
                            }
                        }
                    }
                }
                // ------------------------------
                curDoc.save();
                curDoc.close();
                curDoc = null;
            }
        } else {
            alert('No Illustrator (.ai) files found');
        }
    }
    

    Let us know if it works for you, and if it was useful.

  • rearrange the files in the folder "iTunes media" is gray

    I have a good size iTunes media folder which WAS organized in subfolders - music, movies, etc.  I just noticed that my most recent files are not saved in these subfolders.  Instead, everything will be saved in iTunes Media.  When I consolidate files, everything said is it.  I want to rearrange the files in the folder "iTunes media" but this option is grayed out.  Any suggestions on how to get everything converted?  I am looking at about 80 artists a few singles and other full CD.

    iTunes is a database application. You must organize your music within the interface of iTunes and let iTunes organize real files. Otherwise, it's only a matter of time before the database is interrupted.

  • Download the files from the folder on the external drive

    I have this script that opens the most recent file in a folder.

    However I have now moved to an external drive.

    I thought I would use this line

    last element of the value latestFile (sort (get the files in the folder "HotFolderA" of the "Dropbox folder" from the folder "CloudStorage" in the folder "Volumes" of the file ((path to the startup disk))) by creation date) as alias

    but that

    Result:

    error "' Finder has been an error: cannot get the file \"Volumes\ ' startup disk. " ' number-1728 of the folder "Volumes" of startup disk

    How can I do it keep this method?

    Matt

    tell application "Finder"
      set latestFile to last item of (sort (get files of folder "AA" of folder (path to desktop folder)) by creation date) as alias
    set fileName to latestFile's name
    
     open latestFile
    end tell
    

    You used the backslash \ (like Windows) instead of the slash /.

  • Re: HDR-AS100V-remove the 100AVN folder or the contents of the files in the folder after downloading?

    I was wondering what is the recommended way to free the memory after I downloaded my files do I delete the folder AVN? the files in the folder? or reformat the chip together again?

    Thanks in advance

    Good day Laszlo,.

    We recommend that you format the memory card on the Action cam to free up the storage space on the SD card, this would open up any excess files such as files metadata or exif of previous videos and photos allowing you to maximize the storage capacity of the SD card.

    If my post answered your question, please mark it as "accept as a Solution.

  • Give permission to the domain users to replace the file in the folder created by domain admin

    We have a domain controller in our network. also we have the domain users and domain administrator. We create a batch file that copies a file to the folder by using a script to the server policy when users open a session input/output. However if the admin area access system cant use overwrite file in the folder. We want to give permission to the domain users to replace the file in the folder created by the domain administrator.

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums.

    http://social.technet.Microsoft.com/forums/en/category/w7itpro, w8itpro, windowsvistaitpro, windowsxpitpro, windowsintune

    Hope the information is useful.

Maybe you are looking for