Scripting with Automate Batch mode

Recently I've been running scripts on lots (1000+) files by putting the script in a action and then applying that action to a load of subdirectories in Automate Batch mode.
The script work fine, but I was wondering if is possible to control the way the script is controlled within the batch mode; to be more specific this is what I had in mind: Alter the history and cache levels to a minimum, start a timer, run the image processing script on all the 1000+ files, write the timer result to a text file, put the history and cache levels to how they were previously and finally close down photoshop when the whole thing is finished.
Cheers

If you look about 6 posts down the list you will find Paul's function to recurse folder contents… Swap your batch action for that… Then you just need to get date twice do a little math…
var start = new Date();
$.sleep( 2000 ); // do all your stuff between replacing this…
var end = new Date();
alert( 'Seconds: ' + (end-start)/1000 );
Your timings are milliseconds… I just divided to get seconds… You may want something other…

Similar Messages

  • .sql scripts running in batch mode

    Hi all. Is there any way to run .sql scripts in a batch mode where the job would be time scheduled and run automatically when the specified time arrived? I am using Oracle 10.
    Thank you for any assistance.
    Robert Smith

    Hi Dimitri. A coworker of mine uses dbms scheduler and he has submitted batch jobs. However, I would like to be able to spool to a file, then send the file as an attachment in email. My friend says that the "spool" command will not work when you are inside of pl / sql. He writes to a file using a cursor and loop but he hasn't been able to send the file as an attachment in an email yet. Maybe there is something we don't know about the dbms scheduler yet.
    Robert Smith

  • Having multiple issues with automate batch - skipping files, misplacing watermarks etc

    I record the action exactly how I want it: editing, placing the watermarks (place embedded) putting them where I want them and re-sizing, save as (with jpg details), etc before I stop recording. When I do the Automate Batch with this action, the watermark is placed nearly completely off the image, it will go from file 1 to file 10 (skipping files 2-9) This worked fine on a previous Batch with a similar action. Nothing is working correctly for this one. I have also tried using "Place Embedded" with the same result. The files are NEF files being saved to JPG. After the it finishes the action, the "Save As" menu opens.
    Adobe Photoshop Version: 2014.2.2 20141204.r.310 2014/12/04:23:59:59 CL 994532  x64
    Operating System: Windows 8.1 64-bit
    Message was edited by: Adam Jordan

    It is difficult to process different size image and add watermarks.  You stated your currently processing RAW Nef files.  RAW Files can have ACR setting saved for them which can size them differently. They can never have been processed with ACR so have not setting and will use your default setting for your camera. ACR also remembers your  last used  workflow setting which can change document size.  In your Action I see you using Place which has some setting for the place transform.  However I see no step before the the place to handle document size.  So the place step will work differently on different size documents. The Place is followed by a move and then a second place and move.  You then flatten and save which is not necessary Saving a jpeg from a layered document will save a flat jpeg.  Quality 12 is also overkill.
    This action may work well on a particular size document with the same aspect ratio and orientation but will fail on others.
    Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file.
    More then a dozen Scripts for use in actions
    Download

  • Problems with Automate Batch tasks in Photoshop CS2

    "Could not complete the action, since the destination folder does not exist" message appears when I Automate a task that I have previously recorded and successfully used.
    When I choose Automate, then Batch, then select action, then select a source folder and a destination folder the message appears. Once "OK"  is selected it completes the action but only one image at a time before the error message comes back. If I am repeating the task on a folder with several images, I have to sit and click "OK" to the error message for each image for the task to complete.
    How can I get the Action to Automate itself without the error message popping up? The destination folder does exist and I have tried re-recording the actions but the same message continues to come up.

    Well, maybe "Save for web" command has remembered the folder for saving files. And then you use Automate Batch they trying to save exactly in THAT folder in spite of you choose another in Batch. If that folder doesn't exist program returns en "error" message. Try to restore "original" folder and run Batch again.

  • How to combine offscrub vb script with batch file

    Hello all,
    I am trying to upgrade from Office 2010 to Office 2013, but Office 2013 does not completely remove all of Office 2010 and Visio 2010, so I want to use the offscrub vb script from this article (
    http://blogs.technet.com/b/odsupport/archive/2011/04/08/how-to-obtain-and-use-offscrub-to-automate-the-uninstallation-of-office-products.aspx) to first remove office 2010, Visio2010, and Project. I already extracted the offscrub vb script. How can I combine
    the offscrub vb script with a batch file I created to silently install office 2013, so that after offscrub is finished running, the office2013 install would begin? I would like to apply the file via GPO. Or if there is away that one file calls the other. 
    I would appreciate any help you can provide.
    Thank you

    Yes - that is not GP Software Distribution.  It is a very flakey method as you are finding out.  I highly recommend posting in the Office 2013 administration forum for assistance.  There are many 'gotchas".
    The problems will come as a result of needing to remove 2010.  If 2010 is a trial version or an expired license you will have many issues.  Also the build of the MSP needs to be manged correctly.
    I would add the uninstall script to the MSP package and make it a dependency or try and build an MSI to run the uninstall script using Software Distribution or run it independently and be sure you get a reboot before you attempt to do the install. 
    The Admins in Office 2013 forum will have many bits of experience that you will not likely find here or not find as readily.
    Good luck.
    ¯\_(ツ)_/¯

  • Photoshop CS3 Actions Batch mode bug?

    I posted this in the Mac forum but received no responses after a couple of days, so I am trying it here.
    Photoshop CS3 Actions seem to have a bug such that when used in Automate > Batch mode it will use the name of the first file opened in the batch session for every file processed in that session. Since that name is used in Save step, this means having to deal with the "File Already Exist" dialog for every file in the batch because it is attempting to save at the designated location with the same file name. If the continue option is chosen each time, the final result is one file with the first opened file name, but with the contents of the last processed file.
    To confirm that this is a problem particular to the opening step, I have disabled all processing steps as well as the saving step by toggling them in the Actions panel. I then ran the action in batch mode on a folder containing 4 files. This resulted in 4 opened files all with the same name but different image content.
    This was with the "Override 'Open' Action Commands" checked/not checked, and the "Suppress File Open Options Dialogs"  checked/not checked. The  problem described also occurs when using a Droplet.
    By comparison, Photoshop CS exhibits the expected behavior: when an action is used in batch mode to process an entire folder of files, the name of each file is retained after opening and used after processing in the save or export step.
    The above described behavior of CS3 is a change acquired along the way to the CS3 version (I do not have the CS2 version to test). But more importantly, can someone please report if the CS4 version behaves as I described for CS3, or if it has been returned to the CS behavior?
    OS X 10.4.11
    G4 800 MHz 2 MB L3/processor 1.25 GB SDRAM
    Is this a known bug?
    Al

    Hello Miguel,
    I was going to come back to post some of my findings, one of which relates to your staement:
    "- The open command created by Photoshop 6 doesn't keep the file's name, it is a much simple open command, and so it opens the file with the own file's name."
    In my case I found that my CS version of the "same" action worked, while the  CS3 version failed, precisely because the earlier one records less detail for the open step.
    My need is to convert dozens of Quark pdf files to GIF and JPEG files for the web. What I found after several days of testing is that it is best to record the opening step in CS3 NOT using a pdf file, so that the "Open As Generic Pdf with 'Name____' " would not be coded into the opening step. Instead I recorded the whole action using a PSD file. Then I can proceed to run it in Batch mode choosing a folder of Quark pdf files as the source location with "Override 'Open' Action Commands" checked, and the "Suppress File Open Options Dialogs"  checked, and it opens all the pdf files just fine in some background process, not getting stuck in the details of the file name, and proceeds to cary out the flattening, saving, and closing steps to my chosen target location and uses the finder file name of each pdf files in the source folder to save a filename.ext in the Target folder.
    Contrary to what I stated in my original post, "Override 'Open' Action Commands" checked/not checked does indeed make a difference. If it is not checked, the files do open in batch mode, but the other steps are not performed. There is much more about this that I would like to know, and this may not be a general solution for all types of files that a user may wish to process in batch mode, but it works for my case. The main trick is to use as simple an opening step as possible when recording the action, and then letting Photoshop use whatever background process it requires to open a particular file type. I tested this by manually saving a pdf file to each of the twenty some odd formats available in the save as dialog to a Source folder, and then proceeded to batch process that folder with the action described above, and it worked for all except one.
    So while there may not be a bug involved in this problem, there certainly is a lack of documentation about how the "improvements" in the opening step in newer versions of Photoshop affect using Actions in Batch mode.
    Please comment if you can further explain any of the reported results. In particular, what is the situation in CS4?
    Thanks,
    Al

  • Automatic batch determination when more items have the same material

    Hi guys,
    I have a problem with automatic batch determination in the delivery note where more items has the same material number.
    For example:
    Sales order items
    Item   Material   Q
    1        130         5 kg
    2        130         4 kg
    Stock for this storage location is:
    material    batch    Q
    130           1000     3kg
    130           1001     7kg
    When I create delivery note I get this:
    Item   Material   Q   Batch
    1       130            
    90001 130       3     1000
    90002 130       2     1001
    2       130
    90003 130       3     1000
    30004 130       1     1001
    As you can see, both items has the same batches. This is not good, when post goods issue. Normally there is no stock availaible for both items.
    Is there any customizing to do this correctlly?
    Thanks for an ansver.
    BR, Matic

    What is the purpose of giving the same material as second line item.
    specify in the first line item itself.
    or els the condition record which you have specified that for 100 material of A gives 10 material of B modify it to 10 of A should give 1 material of B
    The first you will be useful for you.

  • IPhoto 4.0 interferes with computer sleep mode?

    It seems that when IPhoto 4.0 app is open, it interferes with automatic sleep mode. I've narrowed it down to iPhoto by trial and error. Any thoughts on correcting this issue?
    My thanks

    I can't be more clear because I don't know what the problem is. My iPhoto is just not behaving the way it should. This is my second Mac with OS X and I know two ways to create a new Library and the results are the same in both senarios...
    I have tried to create a Library by doing what you suggested. I get the box that says my iPhoto Library was not found. If I click "Create Library", it asks "save as" and "where" then iPhoto opens and says "Loading Photos" but never does (and will create an iPhoto Library with the "Library.iPhoto" and "Thumb32.data" docs).
    The same thing happens when I try to create a new Library by starting iPhoto while holding the option key.
    My first post indicated the one thing that worked was to login as a new user. I was asking what the next step was because I thought there was a next step to that process. Guess not?

  • Automatic batch determination for quality inspection stock

    Hello, gurus.
    Could you please, help me with the following problem: I have received on the certain storage location some quantity of material maintained in batches into quality inspection stock with 501 movement type. Now I would like to make reverse posting, but I do not want to use cancellation of the document, I need to use 502 movement type and determine batch from quality inspection stock with automatic batch determination in MIGO transaction. I assigned Batch search procedure to 502 movement type and created all necessary condition records. I use Checking Group for Availability Check ‘CH’ and Checking Rule for Availability Check ‘03’ where I include quality inspection stock. However no batch can be determined. But if I use 331 movement type, everything is OK, the batch is determined without any problems. If I manually put batch and valuation type for the material, the system shows no error.
    Why it is not possible to do automatic batch determination for quality inspection stock then?

    OK, let us talk abou it. I check it in my system, actually 502 can work, but I can't trigger BM determination by 501. Maybe BM determination onlys to select some existing batches for consumption. For 501 in my pratice I can select all the existing batches to be added or just add a new batch.

  • Automatic batch determination during transfer posting. Issue.

    Hi All,
    Please could anyone advise to solve the following problem with automatic batch determination:
    1. When delivery is created for sales order, SAP automatically assigns batch number.(SLOC 1)
    2. From time to time there is a need to transfer the same material number, which is on delivery to another sloc2.
    3. Using Mb1b tcode i do transfer posting from SLOC1 to SLOC 2. In batch field i put * or (**) for automatic generation. (movement 311).
    The problem appears here, when SAP automatically assigns the same batch to transfer posting which was assigned to delivery (p.1).
    So that after transfer posting done, there is no required quantity left in batch needed to do a goods issue for delivery. So goods issue is not possible because of that kind of transfer posting.
    Do you have any idea, how to manage this, and to restrict SAP choosing the same batch which was assigned to delivery.
    Thank you,
    Kind Regards.

    There are 3 strategy types setup in MBC3 (1, 2)
    ME01, ME02 which are standart SAP.
    And one started from Z* with settings below:
    Plnt
    Valid From
    Valid to
    Delet.Ind.
    No. split
    Cpl.change
    OnlineBdet
    UnitofMeas
    MProposal
    Selection
    Sort seq.
    AAAA
    04.01.2006
    31.12.9999
    099
    X
    B
    001
    X
    X
    |
    Date of last goods receipt
    ascending
    Kind Regards,
    Andrey

  • Batch Scripting to Automate PDF Combination/Bookmark Creation

    I have a number of PDFs where some represent emails and some represent attachments to those emails. Currently they are all saved as separate PDF files; what I would like to end up with is a single PDF per email, where each attachment has been inserted after the last email page and a bookmark has been created called the name of the attachment, which is dynamic and not related to the file name.
    I have a list of which PDF attachments would need to be added to which PDF emails, including the name of what each bookmark would be. I have used this list to auto-create a javascript that I thought would do the trick. Here is a sample of what I created:
    /* Combine Files */
    //Open first PDF email and create a bookmark to mark the email
    varMyDoc = app.openDoc("/Z/Projects/IMG_0001/S-00001.pdf")
    varMyDoc.bookmarkRoot.createChild("057-063_Fw _59.msg", "varMyDoc.pageNum=0", 0)
    varPage = varMyDoc.numPages
    //Insert pages from the attachment PDF after the last page of the email and create a bookmark to mark the attachment
    varMyDoc.insertPages ({nPage: this.numPages-1,cPath: "/Z/Projects/MG_0001/S-00002.pdf"})
    varMyDoc.bookmarkRoot.createChild("20060329092508655.pdf", "varMyDoc.pageNum=" + varPage, varPage)
    //Save the new combined PDF to a new location and close it
    varMyDoc.saveAs("/Z/Projects/IMG_0001/S-00001.pdf");
    varMyDoc.closeDoc(true);
    My plan was to create a batch sequence to run this and copy/paste the entire script into the script window. However, I now realize that my script is really not a batch sequence. I can run the first execution (above) as a batch sequence if I have that one file open in Acrobat, but as soon as I try to add in opening the next file, the script stops.
    I don't need to run the exact same commands for every file in a directory, which is what the batch sequence wants to do; I want to simply run the script and have it open, insert pages, make changes, and save the files according to the way the commands are laid out.
    I also tried to save the script with a .js extension and put in the JavaScripts directory, but I get an error in the debugger saying that my variable bookmarkRoot has no properties... the script seems to run differently this way than it does through a batch sequence and my syntax or usage is no longer correct.
    Is there a way to use Acrobat this way? I would try automating this from VBA or something, but it looks from the developer's guide like bookmarks can't be created using that method. I'm basically trying to automate Acrobat from an external script the way you can automate Excel or Word using vbscript; you just make object representing an instance of that application and then you can use methods and properties just like you would if you were scripting inside that application natively. Can an instance of Acrobat be pulled up from just running an external .js?

    Can you be more specific?
    Something like this;
    http://forums.adobe.com/message/1097409

  • Proof prints with filename, batch, automate? help!!

    I am 'action' and 'script' challenged...trying to find a way to automate batch processing of printing 4x6 inch proofs (jpegs to local print lab) with the filename from the EXIF info on them in the lower right corner.  I can get exactly what I want with a  'picture package' action, but once flatted, it won't save to another folder, just sits on the desktop....   I have Win XP, CS2 and 4, and LR2 - Thank you!!
    (just about to escape to the Himalayas and meditate for the duration....so any help is greatly appreciated!!)

    You're in luck. You can use the Object > Captions > Caption Setup to pick Name as the metadata. Then when you place the file turn on Import Options and check Create Static Captions.
    You also can create dynamic captions which pull other metadata from the images but it doesn't sound like that's what you need.
    Also you can read more about Captions in InDesign Help.

  • How  to modified automatic batch number with plant and current year details

    hi all,
            i want tomodify automatic batch number with plant and current year details. if any one understand plz explain.
    thanks,
    radhakrishna.

    Hi,
    I am not clear what is u r requirement exactly?
    I  mean you don't want automatic batch no or modify the batch no.  with plant means and Current year details means.  Can give details more
    Regards
    Ganesh

  • Linkage of Sales Order with OPM Batch automatically through MRP run

    Hi Friends,
    Can anyone please suggest me of how the Linkage of Sales Order with OPM Batch can be created automatically after running OPM MRP.
    Thanks in advance.
    Thanks & Regards,
    Bharathram N.

    Dear Friend,
    Thanks for your update.
    I had the set ups already which you have specified. But I dont see in the action messages screen any sales order number for each action.
    My requirement is following..
    1. I will enter SO for an item called A.
    2. Run MRP.
    3. From Action Message Summary, I will release production batch.
    4. Now the batch been created should have the sales order number from which it came originally.
    Hence to achieve above, I need SO with MRP Link action message(backend or front end)..
    Hope the above scenario is clear to you..Plz let me know your thoughts..
    Thanks & Regards,
    Bharathram N.

  • OTR CREATION IN BATCH MODE / AUTOMATIC "CIF" CUSTOMER IMMEDIATELY AFTER CREATION IN ECC

    Dear All,
    My scenario is: We have a Web dynpro customized screen for Customer Creation and Sales Order creation in SAP ECC. This screen first send data to CRM where Customer is created and Customer code is flowing back to my screen immediately. Using this Customer Code, Sales order is created from the same screen using standard BAPI.
    Now as per standard behavior, data will be sent to TM immediately after sales order creation for OTR creation, where it will fail as customer created was not CIFed to TM. So as per my understanding, my issue can be resolved by any of the following ways:
    Option 1) Automatic CIF customer at the time of Customer Creation: By this if customer will automatically CIFed to TM immediately after the customer is created in ECC through CRM, then there will be no issue even in creating OTR immediately after Sales order creation.
    OR
    Option 2) Creating OTR in batch mode instead of immediately after Sales Order Creation: By this I can first CIF Customer to TM in Batch JOB and then subsequently OTR will be created in Batch Job.
    Please suggest more feasible option out of two options mentioned above and also how to achieve the same?
    Regards,
    Vibhu Gupta

    Hi Vikas,
    1. Could you please show me one of your FU stages info if allowed and show me what you did to achieve step 4 and 5 in the frontend? I want to check in our internal system and see whether this can be achieved from standard point.
    2. How did you achieve the automatic FO creation when building FU? Because when I create a FU, there is no FO created automaticaly.
    Thanks & Best Regards,
    Dawson

Maybe you are looking for

  • ISight not working on new MacBook

    Got my MacBook yesterday, started up and the iSight camera has not worked at all. The green light is lit, but when I use Photo Booth (or any other app using the camera), there is no image, only a solid color. I'm new to Mac's, so any advice is welcom

  • Is there a way to add images to the collection used in Photomerge Style Match?

    When one uses the menu: Enhance->Photomerge® Style Match, there will be six images displayed to choose from. The path to them is (Mac): /Application/Contents/Resources/models/ While this menu is only available in Expert mode, you end up in Guided whe

  • WebI Report Prompt

    Hi All, I am trying to create a report prompt where a user selects a date prior to opening the report. The user selection then sets a variable that I plan to use in a formula. I do not want to use the user selected field as a filter to the report. Fo

  • I am trying to make a second website in iweb, I click 'new site' and select the site style, but it keeps opening my existing website.  Any ideas?

    I am trying to make a second website in iWeb.  I have clicked 'new site' and then selected a style for the website, but then my existing website opens instead of a new one.  Any ideas how to fix this?

  • FSG Report in Discoverer

    I am generating an FSG report in Discoverer. I need to Display the annual budget amount as a data point in crosstab, where as I have grouping on Account number and its sub accounts on left axis and period name as page item. When I create a calculatio