Batch sequence from 2 folders

Hello,
I would like to create a code, where I have a sequence of files in a Left folder and a sequence of files in a Right folder. The goal is to open the left image (L_001) and place the right image (R_001) on top, by creating a new layer. Bottom layer to be called, 'Left' and top layer to be called, 'Right'. Then save the two layered image as a PSD. Then to carry on, L & R _002, 003, so on.
Can you advise me on a code to perform this?
Thanks!

#target photoshop
// dialog for folder-selection;
var theFolderOne = Folder.selectDialog ("Choose the correct LEFT folder of images");
var theFolderTwo = Folder.selectDialog ("Choose the correct RIGHT folder of images");
var theFolderThree = Folder.selectDialog ("Choose the correct MERGE folder of images");
if (theFolderOne && theFolderTwo && theFolderThree) {
var theFilesOne = theFolderOne.getFiles(checkFor);
var theFilesTwo = theFolderTwo.getFiles(checkFor);
// check if both folders contain the same number of files;
if (theFilesOne.length != theFilesTwo.length) {
alert ("the folders don’t contain the same number of images")
// else do the stuff;
else {
// create the psd-options;
psdOpts = new PhotoshopSaveOptions();
psdOpts.embedColorProfile = true;
psdOpts.alphaChannels = false;
psdOpts.layers = true;
psdOpts.spotColors = true;
// run through the files;
for (var a  = 0; a < theFilesOne.length; a++) {
// open background-image;
var theFile = app.open(File(theFilesOne[a]));
theFile.activeLayer = theFile.layers[0];
// place foreground-image;
var idPlc = charIDToTypeID( "Plc " );
var desc6 = new ActionDescriptor();
var idAs = charIDToTypeID( "As  " );
var desc7 = new ActionDescriptor();
var idfsel = charIDToTypeID( "fsel" );
var idpdfSelection = stringIDToTypeID( "pdfSelection" );
var idpage = stringIDToTypeID( "page" );
desc7.putEnumerated( idfsel, idpdfSelection, idpage );
var idPgNm = charIDToTypeID( "PgNm" );
desc7.putInteger( idPgNm, 1 );
var idCrop = charIDToTypeID( "Crop" );
var idcropTo = stringIDToTypeID( "cropTo" );
var idboundingBox = stringIDToTypeID( "boundingBox" );
desc7.putEnumerated( idCrop, idcropTo, idboundingBox );
var idPDFG = charIDToTypeID( "PDFG" );
desc6.putObject( idAs, idPDFG, desc7 );
var idnull = charIDToTypeID( "null" );
desc6.putPath( idnull, new File( theFilesTwo[a] ) );
var idFTcs = charIDToTypeID( "FTcs" );
var idQCSt = charIDToTypeID( "QCSt" );
var idQcsa = charIDToTypeID( "Qcsa" );
desc6.putEnumerated( idFTcs, idQCSt, idQcsa );
var idOfst = charIDToTypeID( "Ofst" );
var desc8 = new ActionDescriptor();
var idHrzn = charIDToTypeID( "Hrzn" );
var idRlt = charIDToTypeID( "#Rlt" );
desc8.putUnitDouble( idHrzn, idRlt, 0.000000 );
var idVrtc = charIDToTypeID( "Vrtc" );
var idRlt = charIDToTypeID( "#Rlt" );
desc8.putUnitDouble( idVrtc, idRlt, 0.000000 );
var idOfst = charIDToTypeID( "Ofst" );
desc6.putObject( idOfst, idOfst, desc8 );
var idAntA = charIDToTypeID( "AntA" );
desc6.putBoolean( idAntA, true );
executeAction( idPlc, desc6, DialogModes.NO );
// save the combined files;
theFile.saveAs(new File (theFolderThree + "/LRMerge" + bufferNumberWithZeros((a + 1), 3) ), psdOpts)
theFile.close(SaveOptions.DONOTSAVECHANGES)
////// check for psd, tif or jpg //////
function checkFor (theFile) {
if (theFile.name.slice(-4) == ".psd" || theFile.name.slice(-4) == ".tif" || theFile.name.slice(-4) == ".jpg") {return true}
else {return false}
////// buffer number with zeros //////
function bufferNumberWithZeros (number, places) {
var theNumberString = String(number);
for (var o = 0; o < (places - String(number).length); o++) {
theNumberString = String("0" + theNumberString)
return theNumberString
I have adjusted this code in terms of folder name in the first few folders, but what I would like to do now is select the background layer and rename that to 'Left' and then the layer on top 'R_xxx' to 'Right'. Not so great at coding, but would appreciate if someone could implement the request into the code above please?

Similar Messages

  • Run batch sequences from plugin

    Hi,
    I'd like to implement a plug-in that adds an additional menu entry to Acrobat Pro's menu. If this menu entry gets clicked by the user, one or more batch sequences should be executed. As far as I have understood the API, this should be possible with AVCommand. However, I couldn't find the required command key string (for ASAtomFromString(...)) and parameters (for ASCab) to trigger a batch sequence execution successfully.
    Could anyone give me a hint how to define such an AVCommand call?
    Thanks

    Oracle version is 10.2, installed on linux. I'm running my client on windows, in which i wan't to access windows file system and run batch procedures there. Is this even possible?No.

  • Additional Batch Sequences for Acrobat 9 Pro

    In my downloaded version of Acrobat 9 Pro, there are only a few batch sequences.
    The last time I bought Acrobat on a CD was version 5, and many additional batch sequences came on the CD.  By "additional" I mean that they were not automatically installed when Acrobat was installed, but they could be installed manually.  One could simply copy the additional batch sequences from the CD into the Acrobat installation, after which all of them would be available via the Acrobat interface.
    Is the same true with a CD version of Acrobat 9 -- i.e., has the Acrobat 9 CD additional batch sequences that can be copied into the Acrobat installation?
    If so, is it possible for a user of the downloaded version of Acrobat 9 Pro to obtain those additional batch sequences?
    On my Acrobat 5 CD, the additional batch sequences were in --
    (optical drive letter):\Batch\Sequences
    In my Acrobat 9 Pro installation (under Windows XP Pro), one would copy additional batch sequences to --
    C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Sequences\ENU
    In both Acrobat 5 and Acrobat 9, it appears that the names of all batch sequence files end in the extension .sequ
    I would particularly like to obtain the "List all Bookmarks" batch sequence.  I copied that sequence from the Acrobat 5 CD to the Acrobat 9 installation, and it "sort-of" works.  The main problem is that its list of bookmarks is limited to one page, regardless of the number of bookmarks.  Any bookmarks that would be listed on pages 2, 3 etc. of the list of bookmarks are not listed at all.
    Is it possible for me to download or otherwise obtain the Acrobat 9 "List all Bookmarks" batch sequence?
    Thanks!

    Thank you, try67, for that insight.
    Here is the "List all Bookmarks" batch sequence from the Acrobat 5 CD:
    /* List all Bookmarks */
    /* Recursively work through bookmark tree  */
    function PrintBookmarks(bm, nLevel)
        if (nLevel != 0) { // don't print the root
            bmReport.absIndent=bmTab*(nLevel-1);
            bmReport.writeText(util.printf("%s",bm.name));
        if (bm.children != null)
              for (var i = 0; i < bm.children.length; i++)
                PrintBookmarks(bm.children[i], nLevel + 1);                          
    bmTab = 20;
    bmReport = new Report();
    bmReport.size = 2;
    bmReport.writeText(this.title);
    bmReport.writeText(" ");
    bmReport.size = 1.5;
    bmReport.writeText("Listing of Bookmarks");
    bmReport.writeText(" ");
    bmReport.size = 1;
    PrintBookmarks(this.bookmarkRoot, 0);
    global.bmRep = bmReport;  // make global
    global.wrtDoc = app.setInterval(
        'try {'
        +'       reportDoc = global.bmRep.open("Listing of Bookmarks");'
        +'       console.println("Executed Report.open");'
        +'       app.clearInterval(global.wrtDoc);'
        +'       delete global.wrtDoc;'
        +'       console.println("Executed App.clearInterval");'
        +'       reportDoc.info.title = "Bookmark Listings";'
        +'       reportDoc.info.Author = "A. C. Robat";'
        +'} catch (e) {console.println("Waiting...: " + e);}'
        , 100);
    I am not a programmer, and so would be grateful if you would advise how that sequence should be modified to incorporate your suggestion.
    Thanks!

  • Example of running a batch sequence without Evermap

    Good afternoon
    I am trying to run a batch sequence in Acrobat X from a button on a form in MS Access.
    I am aware that it is not possible to run a batch sequence (action) from the command line - you need to purchase Adobe's partner Evermap's AutoBatch to do this - but is it possible to recreate all of the menu selections etc. using the SDK?
    I know that Evermap provides this facility but has anyone else created the code to do this?
    It seems like it would be a really useful tool for Adobe to add to Acrobat but then I am not aware of the reasons why they have chosen to leave it out.
    Many thanks,
    Martin.

    Okay, but Evermap (the Adobe Solutions Partner) have developed and are selling a plugin that allows people to run batch sequences from the command line.
    Why do Adobe allow a plugin that allows enhanced command line options but then not incorporate the option as part of Acrobat as standard?
    On the one hand I hear Adobe saying that you cannot run enhanced command line options due to technical and legal issues but then on the other we see Adobe's Soutions Partner selling a plugin to do exactly that.
    Can you please unconfuse me?

  • Batch Capture from Offline Sequence

    I have some older projects that I need to revisit and since the original capture files are no longer around I told FCP to batch capture the sequence from the original media (actually AVCHD files on folders). However it only brought in about 80% of the footage leaving the remaining 20% offline.
    I went to the browser and manually brought those files in - so I managed to recover the sequence in the end, but is there anything I could have done wrong to make it only bring in 'some' rather than 'all' the offline media for a given sequence?

    Create a new sequence and delete all the audio in the timeline. This should reduce the amount of media needing to recapture. It still may show a time larger than the length of your sequence. Even with out handles. Not sure why.
    Also, make sure all the clips have timecode and a reel number. It won't deleted the unused portions if it doesn't have it.

  • Batch Sequences can't convert 10.000 pdf-files at one time

    I have Acrobat Professional 7.0 and I am running on Windows XP.
    To convert from PDF to EPS I am using Advanced - Batch processing - Batch Sequences.
    Every week I have around 5.000 PDF-files which have to convert to EPS without any problems.
    Sometimes I have more than 10.000 PDF-files. After converting to EPS I thought Acrobat Pro was finishing to convert all the PDF, but if I look at the number of EPS, it seems Acrobat Pro didn't convert them all and it didn't give any error message.
    This always happened when I have more than 10.000 PDF-files.I think Batch sequences cannot convert above 10.000 files at one time.
    Is this a known issue? Is there any solution?

    File > Export >  Export Multiple Files will work as well.
    You can choose your conversion settings in Edit > Preferences > General > Convert from PDF.

  • How to run a batch file from within an Oracle 9i Form?

    Hi, I would like to execute a batch file from within an oracle form - I'm assuming there's some PLSQL command I can use? I am not allowed to use any third party libraries, and I'm hoping I can get away without having to progam any C or Java to do it. I don't want to run my java program from my form, but my lecturer is insisting on it.
    Can anyone help?
    Thanx
    Adam

    Can u give me an example
    I need to run a batch files that does a series of step doing dir ( in 3 different folders)
    after each one it shows on screen with a pause & user press enter
    can this work out ?

  • Batch sequence folder location in Win7

    Sorry to duplicate this -- got the message saying it was answered, but the link led nowhere and the question itself appears to have vanished.
    I'm trying to figure out where to copy my user-defined batch sequences for the migration from the old WinXP PC  to the new Win7 PC. The folder path for these on the Win XP machine seems to have no counterpart in Win7.
    Same program version & edition (AA 9 Pro) on each machine -- deactivated on the old one & installed on the new.
    Thanks much.
    Mark

    Thanks, try67. For anyone else looking for this (and perhaps having no idea what the JS console is or how to access it, as I didn't), the batch sequences path for a a standard Win7 installation and AA 9 appears to be:
    C:\Users\YourLoginName\AppData\Roaming\Adobe\Acrobat\9.0\Sequences

  • Batch Sequence Rendering

    Hey people
    Is there a way to batch render multiple Sequences from the Browser?? Same deal as with normal 'batch export' but batch render instead. Iv tried selecting sequences and hitting 'render', 'render all' and that carry on but it only renders the top sequence. This maybe a dumb question but it would help alot to find an answers.
    Cheers Meke's

    You should be able do it from the browser. Just select them and choose 'MainMenu/Sequences/Render All' (might want to close all open timeline sequences first, so you know exactly what's getting rendered)
    Or you could open those sequences you wanted rendered in the timeline and reset your 'auto-render' to something short.
    Just make sure you reset your auto-render after you've finished or you'll have render mania going on.
    K

  • Batch sequence to remove document JavaScript

    Does anyone know of a batch sequence that can remove the document JavaScript from a group of Acrobat 9 Pro PDFs?

    If the doc-level Javascript names are not known in advance, then the only way I found to remove all of the Javascripts is with doc.extractPages(), which will create a new doc object, and then newDoc.saveAs() followed by newDoc.closeDoc().
    I don't do this in a batch sequence but in a .Net app, so I'm not entirely sure how you would write this in a batch sequence.  Here's a code snippet that shows the basic logic:
                    object AcroJS = AcroPDDoc.GetJSObject();
                    string PdfFullPath = "C:\\filename.pdf";
                    Type T = AcroJS.GetType();
                    object newDoc = T.InvokeMember("extractPages", InvokeMethodFlags, null, AcroJS, null);
                    AcroJS = null;
                    AcroPDDoc.Close();
                    object[] saveAsDataParam = { PdfFullPath };
                    T.InvokeMember("saveAs", InvokeMethodFlags, null, newDoc, saveAsDataParam);
                    T.InvokeMember("closeDoc", InvokeMethodFlags, null, newDoc, null);
                    newDoc = null;
                    AcroPDDoc.Open(PdfFullPath);
                    AcroJS = AcroPDDoc.GetJSObject();
    This can also be used to create a new doc GUID.
    Bill

  • Batch Sequence Problem

    I am using Acrobat 9.4. I have a JavaScript that runs a batch sequence to create pop-up tool tips for certain words and phrases. The sequence works properly on most PDF files. I have a problem that on one basic PDF file the batch sequence properly creates the pop-ups but in the process converts the file to a PDF Form. The JavaScript author believes the problem must be that Acrobat adds Form Fields to the basic PDF file during the sequence operation and then thinks the file is a PDF Form. Is there any way to stop this from happening?

    Technically, a document with just a single button is a form. If you mean that the Forms document message bar appears, then that's a known problem. There is a user preference that controls whether the message bar is shown, but it's up to the user to set it.
    Without seeing the code, it seems apparent that it does add some type of form fields to the document to implement the tooltips and that is indeed the reason you're seeing the mesage bar.

  • Batch Sequence Page Scaling

    I have a few hundred PDFs that I need to change the page scaling on, hopefully using a batch sequence or another automated method. I know I can change a single PDF in Acrobat by going to the Advanced tab on the Document Properties and setting the Page Scaling to Default, but I do not want to change hundreds of PDFs manually. I have also tried creating a PDF package and changing the document properties, but it only affects a single PDF in the package.
    I am really looking for a JavaScript code to use in a batch sequence that will change the page scaling to either "fit to printable area" or "shrink to printable area" and save the document with that setting so I can distribute them to others with the page scaling already set and ready from them to print.

    I have been able to use code in Acrobat 6 Standard (Advanced - JavaScript - Document Actions - Document Will Print) to change the page scaling on documents, but it only saves the action in Acrobat 6 and does not save the print setting when the PDF is opened in Reader or Acrobat 8. I tried copying the full acro_script from Acrobat 6 to 8 using a batch sequence in 8, but it does not work.
    Code used in Acrobat 6:
    var pp = this.getPrintParams;
    pp.Handling = pp.constants.handling.shrink;
    Is there a way to convert this code to work in 8? And is there somewhere else in Acrobat 8 (I have Pro) to enter JavaScript besides in a batch sequence?

  • Javascript in batch sequence

    I've done some Acrobat scripting but mostly through VB and I'm able to write what I need but I want to have it as part of my operator's Acrobat instead of the of separate program. That said, I want to write a Java script that I can include in batch sequence.
    I need to add a page to the start of a document and I want to have that page be nubered "a" without disturbing the numbering else where in the file. By simply adding the page at the start with the batch sequence it adopts the numbering of the first page. So if the first page is numbered as "i" then the new inserted page gets numbered "i" and the rest of the numbering changes, what was i becomes ii, what was ii becomes iii, and so on. I'm able to script this in VB by adding the page at the end, renumber them using the SetPageLabels from a Javascript object, then moving the page to the beginning.
    Is there any documentation on using Javascript within a batch sequence?
    Thanks,
    Ken

    Well, hacking along here working in the console pasting my code in.
    The script adds a single page from another Acrobat file to the start of the open PDF. I need the page that goes in at the front to be numbered "a" and NOT effect numbering in the rest of the pages. Some files work fine, other files not so much, like the Javascript API reference PDF as well as other PDFs we've created here form InDesign.
    The script inserts a page at the end of the PDF and numbers that page "a" then moves it to the start of the document. The problem occurs when the page is moved to the start, it changes the number of all the other pages to follow page "a" which is a bit of a silly thing to have to send my clients. I decided to compromise and if the first page (before I insert the anything) was numeric I would simply try changing things to start page 1 after my inserted page "a".
    My code looks like this:
    var NumPages = this.numPages
    var PgLabel = this.getPageLabel(0)
    this.insertPages(NumPages-1, "/F/TNTSTUFF/Disclaimers/HUP_ProofNotice.pdf")
    this.setPageLabels(NumPages,["a", "", 1]);
    this.movePage(NumPages, -1)
    if (PgLabel.match("((-|\\+)?[0-9]+(\\.[0-9]+)?)+")) {  
            this.setPageLabels(1, ["1", "", 1]);  
    However, the setPageLabels command is causing this error:
    RaiseError: The base pages object is missing or invalid.
    Doc.setPageLabels:7:Console undefined:Exec
    ===> The base pages object is missing or invalid.
    I'm not sure it is relavent, but on the files that work the numbering in Acrobat looks like this with the parentheical numbers:
    Files that DON'T work look like this, with NO parenthetical:
    Even if I manually renumber the pages starting with 2 to make the numbering in the 2nd file look more like the numbering in the first file, I still get the error.
    Is there a way I can overcome this with Java code and what the heck is it?
    Thanks again to anyone who can help.
    Best,
    Ken

  • Batch management from SD perspective

    I am new to sap sd. I would like to know about the batch management from a SD perspective.Appreciate if the configuration is explained in a step by step manner

    Dear srirama
    Steps to configure Batch Management
    1)  Specify Batch Level
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Specify batch level and activate batch status management Transaction  OMCT
    2)  Batch Number - Activate Internal Number Assignment
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Number Assignment --> Activate internal batch number assignment Transaction  OMCZ
    3)  Batch Creation - for Goods Movements 
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Creation of new batches --> Define batch creation for goods movements
    4) Characteristic Value Assignment -- Update Standard Characteristics 
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Characteristic Value Assignment --> Update Standard Characteristics 
    5) Activate Batch Classification for Goods Movements in Inventory Management 
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Characteristic Value Assignment --> Valuation for goods movements --> Activate Batch Classification for goods movements in Inventory Management Transaction  OMCV
    6) Batch Determination – Condition Table(Cross Client)
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Condition Tables --> Define production order condition tables Transaction  OPLB
    7)  Batch Determination – Condition Table(Cross Client)
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Condition Tables --> Define SD condition Tables Transaction  V/C7
    8) Batch Determination – Access Sequence(Cross Client)
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Access Sequences --> Define Production Order Access Sequences Transaction  OPLF
    9) Batch Determination – Access Sequence(Cross Client)
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Access Sequences --> Define SD Access Sequences Transaction  V/C2
    10) Batch Determination – Strategy Types
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define Production Order Strategy Types Transaction  OPLE
    11) Batch Determination – Strategy Types
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define SD Strategy Types Transaction  V/C1
    12) Batch Determination – Batch Search Procedure
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define IM   Search Procedure Transaction  OMCY
    13) Batch Determination – Batch Search Procedure
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define Production order Search Procedure Transaction  OPLG
    14) Batch Determination – Batch Search Procedure
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define SD Search Procedure Transaction  V/C3
    15) Batch Determination – Batch Search Procedure Allocation
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Allocate IM search procedure/activate check Transaction  OMCG
    16) Batch Determination – Batch Search Procedure Allocation
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Assign Search procedure to production order Transaction  OPL8
    17) Batch Determination – Batch Search Procedure Allocation(SD)
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Allocate SD Search procedure Transaction  V/C5
    18) Batch Determination – Activate Automatic Batch Determination(SD)
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Activate Automatic Batch Determination in SD -->For delivery item categories Transaction  V/CL
    19) Batch Determination – Batch Selection Class
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define Selection Classes Transaction  CL01
    20) Batch Determination – Sort Rule
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Batch Determination & Batch Check --> Define Sort Rules Transaction  CU70
    21) Batch Determination – Make Settings for Batch Where-used list
    Menu Path  Enterprise Structure> Logistics General> Batch Management --> Make Settings for Batch Where-used list Transaction  OMBB
    thanks
    G. Lakshmipathi

  • Batch Sequences missing

    Why is Batch Sequences missing from my Acrobat > Advanced > Document Processing menu?

    Standard or Professional? Why haven't you updated to 8.1.2? Is this the trial version?

Maybe you are looking for

  • Problem in ELM for BPs

    Hi All, I have created an implementation of BADI definition - CRM_MKTLIST_BADI for creating business partners. This Z implementation has been created to add some more fields at BP creation. But although the Z implementation has been created, it's sti

  • Setting default value to columns on tabular form is not working.

    Hi, I created a tabular form and i want to set some default values to columns based on the values in page items. so i set the page item to column value in tabular form attributes by selecting the Default type as PLSQL Expression & Function DEFAULT va

  • Problems uploading photos - some missing

    In creating a new website with approximately 50 photos in a gallery, when I go to upload them (to my own website via ftp client, not .mac) I get errors that it "can't change directory. No such file or directory" referring to the directories that iWeb

  • Manual PR block for MRP items

    Hi Buddies I would like to have the solution while taking my client requirements. The client wants controlling of Inventory budget. They have more MRP items which is creating the PR. But some of the users also processing the manual PR for MRP items.

  • Reg: LQUA (Table) and MMBE ( T-code ) Data

    Hello, Experts. can any one explain what data this fields hold, data in this field are not matching with the data with MMBE T-code. Please can you calrify my doubt. Available stock ( LQUA_VERME) Total Quantity (LQUA_GESME ) does the data in MMBE ( t-