Applescript Photoshop batch

Hello !
     I'm trying to make an applescript that will run a batch procedure in photoshop and I don't know how to write its code. Let me show my script :
set pasta_evento to choose folder with prompt "Select folder of the event: "
set pasta_tratadas to (pasta_evento as string) & "Tratadas:" as alias
set arq_log to (pasta_evento as string) & "Log_Erros.txt"
tell application "Finder"
          if not (exists file arq_log) then
  make new file at pasta_evento with properties {name:"Log_Erros.txt"}
          end if
end tell
set Fotos to files of pasta_evento as alias list
tell application "Adobe Photoshop CS6"
  activate
                              set display dialogs to never
                              batch "13 x 19 + sharpen" from files Fotos  from "My Actions" with options {destination:folder, destination folder:pasta_tratadas, error file:alias arq_log}
end tell
When I run it, Photoshop opens a dialog informing : "There were no source files that could be opened by Photoshop".
I realized that if I change the instruction as below, it works. So, there's something wrong with the variable Fotos - I tried to feed it with strings but didn't know how to do it.
tell application "Adobe Photoshop CS6"
  activate
                              set display dialogs to never
                              batch "13 x 19 + sharpen" from files {"Disk:Users:Me:Pictures:Macros:Tratadas:0002.JPG", "Disk:Users:Me:Pictures:Macros:Tratadas:0025.JPG"} from "My Actions"
When I run the same script with the batch, Photoshop says there's something wrong with the batch command. I tried to read the photoshop applescript ref, but I don't know what's wrong.
Could anybody help me correct this code ? I'm not definetively an expert!
Some refs about batch and batch options :
batch v : run the batch automation routine
batch text : the name of the action to play (note that the case of letters in the Action name is important and must match the case of the name in the Actions palette)
from files list of alias : list of input files to operate on
from text : the name of the action set containing the action being played (note that the case of letters in the Action Set name is important and must match the case of the name in the Actions palette)
[with options batch options] : options for Batch
batch options n : options for the Batch command
properties
destination (folder/none/save and close) : final destination of processed files ( default: none )
destination folder (alias) : folder location when using destination to a folder
error file (alias) : file to log errors encountered, leave this blank to stop for errors
file naming (list of ddmm/ddmmyy/document name 3/document name lower/document name mixed/extension lower/extension upper/mmdd/mmddyy/serial letter lower/serial letter upper/serial number four/serial number one/serial number three/serial number two/yyddmm/yymmdd/yyyymmdd) : list of file naming options 6 max.
macintosh compatible (boolean) : make final file name Macintosh compatible ( default: true )
override open (boolean) : override action open commands ( default: false )
override save (boolean) : override save as action steps with destination specified here ( default: false )
startingserial (integer) : starting serial number to use ( default: 1 )
suppress open (boolean) : suppress file open options dialogs ( default: false )
suppressprofile (boolean) : suppress color profile warnings ( default: false )
unix compatible (boolean) : make final file name Unix compatible ( default: true )
windows compatible (boolean) : make final file name Windows compatible ( default: true )
Tks !

List of files must be not an alias, but a text string.
Adding something like that to your code must help:
  set PhotoshopFiles to files of folder_to_run as alias list
  set FileNames to {}
  repeat with i from 1 to the count of PhotoshopFiles
       set current_file to item i of PhotoshopFiles
       copy current_file as text to the end of FileNames
  end repeat
  tell application "Adobe Photoshop CS6"
       activate
       try
            set Batch_Options to {class:batch options, destination:save and close, error file:Error_File, file naming:{document name lower, extension lower}, macintosh compatible:true, override open:false, override save:true, suppress open:true, suppressprofile:true, unix compatible:true, windows compatible:true}
            batch script_name from files FileNames from action_set_name with options Batch_Options
       end try
  end tell

Similar Messages

  • How to use applescript photoshop batch

    Hello, good afternoon.
         I'm trying to make an applescript that will run a batch procedure in photoshop and I don't know how to wirte its code. Let me show my script :
    set pasta_evento to choose folder with prompt "Select folder of the event: "
    set pasta_tratadas to (pasta_evento as string) & "Tratadas:" as alias
    set arq_log to (pasta_evento as string) & "Log_Erros.txt"
    tell application "Finder"
              if not (exists file arq_log) then
      make new file at pasta_evento with properties {name:"Log_Erros.txt"}
              end if
    end tell
    set Fotos to files of pasta_evento as alias list
    tell application "Adobe Photoshop CS6"
      activate
                                  set display dialogs to never
                                  batch "13 x 19 + sharpen" from files Fotos  from "My Actions" with options {destination:folder, destination folder:pasta_tratadas, error file:alias arq_log}
    end tell
    I think I have two problems. I realized that if I change the instruction as below, it works. So, there's something wrong with the variable Fotos and with the batch options (I tried to read the photoshop applescript ref, but I don't know what's wrong.
    tell application "Adobe Photoshop CS6"
      activate
                                  set display dialogs to never 
                                  batch "13 x 19 + sharpen" from files {"Disk:Users:Me:Pictures:Macros:Tratadas:0002.JPG", "Disk:Users:Me:Pictures:Macros:Tratadas:0025.JPG"} from "My Actions"
    Could anybody help me correct this code ? I'm not definetively an expert!
    Tks !

    Hi Muppet, tks for the help !
         I tried to feed it strings by many ways friend, but I as I told you I'm not an expert and couldn't make it work... So sad ...
         When I run :
    batch "13 x 19 + sharpen" from files Fotos  from "My Actions"
    In  the results it comes :
    batch "13 x 19 + sharpen" from files {alias "Disk:Users:Me:Pictures:Macros:Tratadas:0002.JPG", alias "Disk:Users:Me:Pictures:Macros:Tratadas:0025.JPG"} from "My Actions"
    And it doesn't work, Photoshop opens a dialog informing : There were no source files that could be opened by Photoshop.
    When I write the alias list manually it starts the batch command.
    batch "13 x 19 + sharpen" from files {"Disk:Users:Me:Pictures:Macros:Tratadas:0002.JPG", "Disk:Users:Me:Pictures:Macros:Tratadas:0025.JPG"} from "My Actions"
    In the Applescript Photoshop Ref:
    batch v : run the batch automation routine
    batch text : the name of the action to play (note that the case of letters in the Action name is important and must match the case of the name in the Actions palette)
    from files list of alias : list of input files to operate on
    from text : the name of the action set containing the action being played (note that the case of letters in the Action Set name is important and must match the case of the name in the Actions palette)
    [with options batch options] : options for Batch
    AND
    batch options n : options for the Batch command
    properties
    destination (folder/none/save and close) : final destination of processed files ( default: none )
    destination folder (alias) : folder location when using destination to a folder
    error file (alias) : file to log errors encountered, leave this blank to stop for errors
    file naming (list of ddmm/ddmmyy/document name 3/document name lower/document name mixed/extension lower/extension upper/mmdd/mmddyy/serial letter lower/serial letter upper/serial number four/serial number one/serial number three/serial number two/yyddmm/yymmdd/yyyymmdd) : list of file naming options 6 max.
    macintosh compatible (boolean) : make final file name Macintosh compatible ( default: true )
    override open (boolean) : override action open commands ( default: false )
    override save (boolean) : override save as action steps with destination specified here ( default: false )
    startingserial (integer) : starting serial number to use ( default: 1 )
    suppress open (boolean) : suppress file open options dialogs ( default: false )
    suppressprofile (boolean) : suppress color profile warnings ( default: false )
    unix compatible (boolean) : make final file name Unix compatible ( default: true )
    windows compatible (boolean) : make final file name Windows compatible ( default: true )
    When I try to use the batch options Photoshop it says the batch command is invalid or not supported.
    With these informations do you could help me ?
    I'm loosing my hopes ...
    Tks !

  • Looking for a howto for an applescript to batch convert PPTS to Keynote...

    Looking for a howto for an applescript to batch convert PPTS to Keynote...
    Hi to group!
    (cross posted this a couple of weeks ago to Keynote forum, no responses) Perhaps the query really belongs here...)
    (I) Have a whole bunch of PPTs to convert to Keynote, now and more as time goes on.
    Looked into applescript to try to automate this a bit (could open PPT file but did not see any way to 'Save' file from a script).
    Also looked into bash scripting/automator too -- way too many options to choose from. Help!
    Anybody done anything similar to this already?
    TIA for pointers. //GH

    A word of caution.
    I have not tried the workflow before.
    I am not an applescript expert.
    These steps were quickly composed using my basic knowledge in Applescript
    What I was planning was to create a script droplet that when a ppt file is dropped upon it, it extracts the name of the file and sets it to a variable to name the keynote file later. You might have to modify it a bit to batch process multiple files.
    Try going through batch processing scripts made for quark or Adobe photoshop ( Not sure if these exist on internet) to see how they have implemented the steps in applescript.
    To GUI Script Keynote, do these steps...
    All the code has to go in here
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">activate application "Keynote.app"
    tell application "System Events"
       tell process "Keynote"
          -- insert GUI Scripting statements here
       end tell
    end tell
    </pre>
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">click menu item "Export…"  of menu 1 of menu bar item "File"  of menu bar 1</pre>
    This will click the next.. button provided the default export type is set to PPT
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">click button 2 of sheet 1 of window 2
    </pre>
    This will click the Export button on the next window
    click button 1 of sheet 1 of window 2
    This piece of code can be used to set the name of the ppt file using the extracted name in the first step
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">set value of text field 1 of sheet 1 of window 2 to "<string>"
    </pre>
    May be there is a better way out there.
    Thanks for red_menace for his Script formatter script
    Message was edited by: dj9027

  • Bridge CC Tools - Photoshop - Batch does not work in Photoshop CC 2014.

    in Bridge CC Tools - Photoshop - Batch does not work in Photoshop CC 2014. At first I didn't even see the option but I reinstalled Photoshop CC and now I see the menu option but when I try it there is a message that I need to use Photoshop CC. So I open Photoshop CC and the same thing happens? I can't seem to make it work.

    Kitty,
    Your screen shot is in the virus scanning queue, where it can linger for minutes, hours, days or weeks.
    If you use the camera icon in the reply editor's formatting bar, you can embed your image in your post, where it will be viewable instantly.
    then:
    As for your issue, make sure all applicable scripts are checked in Bridge preferences:

  • Problem with Bridge CS5 and Tools Photoshop Batch

    When I select several images in Bridge CS5 and go to Tool>Photoshop>Batch and try an run an Action, I receive an error message asking for the Install disk. Bridge at that point freezes until I put in the install disk and then it runs the batch action fine.
    This is very annoying as I always have to have the disk in my DVD Drive.
    Any points would be welcomed.
    Thanks,

    Go to preferences/startup scripts and make sure there is a check mark for Bridge and Photoshop scripts.

  • Bridge menu item tools photoshop batch is not present in CS4

    I recently installed CS4 on an iMac running OS 10.5.7.  I have a 3.06 GHz Intel Core 2 Duo processor, with 4 GB of ram.  The hard drive is 1 Terrabyte.
    In CS3 I could invoke my photoshop actions from bridge.  No such luck here.  I'm finding references to tools>photoshop>batch, but am at a loss as to why I don't see this option in my copy of Bridge. 
    Online help isn't helping or I'm not using the correct search criteria.  Any assistance would be greatly appreciated.  I've attached a screen grab of the menu list.
    Kittie Rue Deemer

    Kitty,
    Your screen shot is in the virus scanning queue, where it can linger for minutes, hours, days or weeks.
    If you use the camera icon in the reply editor's formatting bar, you can embed your image in your post, where it will be viewable instantly.
    then:
    As for your issue, make sure all applicable scripts are checked in Bridge preferences:

  • Photoshop batch processing missing from menu

    Hi everyone:
    I'm having a terrible time today trying to process the 3500 images I've got. I set up an action to process them, but I can't figure out how to link them to be used through Bridge. I'm running Bridge CS5 with PS CS4, and I'm used to going to Tools->Photoshop->Batch. It's missing entirely from the menu.
    I did a bunch of research and found that this issue likely has something to do with the Startup Scripts. So I checked those, and Photoshop is missing from the options. I can't find where that script right reside, as the folder the scripts are supposed to live in appears to be empty (I do have Adobe Bridge CS5 and InDesign CS5 as options, though the script folder itself is empty).
    If it's a simple matter of installing the appropriate script, where might I find it? And if not, how can I solve the problem?

    If it's a simple matter of installing the appropriate script, where might I
    find it? And if not, how can I solve the problem?
    By default they are installed in the library at root level ( Mac OS:
    //Library/Application Support/Adobe/Startup Scripts CS4/Adobe Photoshop/)
    but I have no experience with - nor would I recommend - the use of CS5
    Bridge with PSCS4.
    If you don't have installed PSCS5 for whatever reason your fastest way would
    be to start Bridge CS4. Let the folder with the files cache first and use
    that Bridge version with PSCS4 to perform your batch. BTW, you can save and
    export the actions from PSCS4 as a set and import them again in PSCS5.
    And of course you could also open the batch in PS itself like we used to do
    in the past before Bridge. PS/File/Automate/Batch and choose the folder you
    want to apply the batch in.

  • Photoshop- Batch tool missing in Bridge?

    My Photoshop-> Batch is missing from the bridge tools menu?  And when I go into Photoshop to automate->Batch I can't choose Bridge as a source. It is there, but it is not in bold(i.e.cannot be selected.)
    I have checked my Bridge->Preferences-> Start up script, and all Photoshop options are checked there. I have also tried enabling them agin, and then restarting Bridge, and resetting Bridge Preferences, still  nothing.  I also tried to delete plist files in my library- I just deleted the bridge one- but I'm not sure what that really does, in any case, it didn't work.
    I used to work. Any suggestions??

    mydogcalli wrote:
    But my problem is that in Bridge, all I have under the tools menu is cache, the Photoshop->Batch option isn't there anymore.
    In that case, something is wrong with your install. Only thing I can offer is to do an uninstall and a fresh install.

  • Bridge CS6 Photoshop Batch tool to open Photoshop CC

    I have both CS6 and CC installed
    I'm having the issue in Bridge CS6 that when I want to do a batch function through Tool > Photoshop > Batch this opens Photoshop CS6 and not Photoshop CC which i'd prefer it open. Is there any way to set this.
    The question of me will be why I don't use Bridge CC. Unfortunately I am locked into having to use InDesign CS6 for my work and use a shortcut to reveal images in Bridge (which will only reveal on Bridge CS6), hence why I'm then forced to use Bridge 6 over Bridge CC....
    So I suppose if I worked out the indesign issue i twould be ok, but I have a feeling i'll have more luck with a solution for Bridge opening a version of photoshop than solving the indesign issue.
    Thanks.

    Okay... but I'm using Bridge CC and when I use Tools> Photoshop > Batch it opens the files in Photoshop CS6.
    How do I get Bridge CC to open images in Photoshop CC?
    (Both versions of Photoshop are loaded on my computer.)

  • Need an expert : How to crop some pictures in a Photoshop batch?

    Hi everybody,
    Here is my scripting problem.
    I have scanned a lot of slides and negatives with a specific scanner.
    Before to scan, I haven't limited the image to strict necessary selection.
    In consequence, I have thousands of photos which have 1, 2, 3 or sometime 4 borders black or white around the picture that I would like to delete.
    I would like to obtain some full images without any border (even if a little part of the picture is lost during the operation).
    For me, a manual cropping is too long to realize on each photo.
    I would like to script this action with a photoshop batch...but how to do???
    I don't want to reduce the picture without to be sure that there is some black or white on the border.
    I don't want to sacrifice 10% of the picture if it is not necessary.
    Pictures are not exactly on the same position on each image...it is the problem.
    Is there a function which can detect these borders to crop the picture to the exact maximum size?
    An example is probably better than my poor english...look at example.jpg please (I just would like to obtain the image in the red selection after the script)
    Thank you in advance for your help.
    I don't know how to do...
    Laurent

    Hi Paul,
    Your link is very interesting.
    I have done many test with the function Crop and Straighten (in File/Auto) but...this feature doesn't seems to work?!!
    I have tested with 1 and more photos in the zone, with a white or a black background and on a flat image...but the feature doesn't detect any picture?
    I don't understand why.
    Any idea?
    Thank you in advance
    Best Regards
    Laurent

  • Can Photoshop Batch Resize Tiff Files?

    I have quite a number of tiff files that I want to resize in terms of page dimensions and retain the same resolution / dpi. Can Photoshop batch resize tiff files?

    Yes Photoshop ships with a plugin Fit image you can record an action to re-size an image to fit within some number of pixels.  Image resolution setting and aspect ratio are not changed however the number on pixels the image will have will be less then or equal to the pixels size set.    For example if you set width and height to 2000px the largest size image you could have after the operation would be 1:1 aspect ratio square 4MP 2000x2000.  If your image has a landscape aspect ratio the re-sized image will be 2000px wide by less then 2000px high and if Portrait the re-sized is will be 2000px high be less then 2000px wide.  Bicubic Interpolation for the re-size.
    Once you record the single step action.  You can batch the action.  You can have batch open the image files and save over the original files or have batch save the resized files in a different location. Fit Image and Batch are both found in menu File>Automate>

  • Bridge photoshop batch problem

    Hi there,
    After upgrading to Photoshop CS4 from CS3 (new install), I am having a problem with running Photoshop batch from bridge.
    I have actions that work fine when run from Photoshop but fail when run from bridge.
    I don't seem to be able to run any Photoshop actions from bridge without a failure.
    The error messages include:
    "JavaScript code was missing"
    "The command 'Pixel Genius PhotoKit Capture Sharpener Expert' is not currently available"
    As well as other seemingly random "the command .... is not currently available".
    I am running Vista 64 bit.
    If anyone has any ideas - I would appreciate them.
    Thanks,
    Richard.

    Hi there again,
    An update to this problem.
    The problem appears to be with Bridge-Photoshop communication.
    I select images in bridge, choose Tools->Photoshop->Batch.  Photoshop opens and I select the Action to run and click OK.  At this point, if Photoshop had no image already loaded then the Action fails because there is no image, ie. the selected images from Bridge are not opened in Photoshop.  The error messages are consistent with having no image loaded to run the various action tasks on.
    If Photoshop already had an image loaded, then it proceeds to run the Action, once for the number of images I first selected in Bridge, but on the image that was already loaded - not on the images selected in Bridge.
    I have deinstalled and reinstalled Photoshop and all its updates with no change.  Any ideas at all would be appreciated.
    BTW Image Processor works ok when invoked from Bridge.
    Tks,
    Richard.

  • Buglet in Tools/Photoshop/Batch file list

    I was just having a look at this and noticed that for me when I use it to run a trivial action in PS from Bridge (just opens selected files and leaves them open) it is opening the selected files PLUS one other file that is not selected. The file it is opening is always the same one and this persists even after opening and closing Bridge - so I would guess it is something happening either at the scriptstore level or within the core of PS / BR itself. It is not a problem with the Bridge selection list since I tested for this with my own batch process scripts and got the expected results.
    Andrew

    Andrew,
    To make things perfectly clear for me, is this the menu item
    Tools -> Photoshop -> Batch...
    Or is it a script that you've written that uses scriptstore?
    The menu item for Batch... doesn't use scriptstore afaik
    Bob

  • How can I do a Photoshop batch edit from Lightroom?

    In Bridge, I can go to tools > Photoshop > Batch and select a Photoshop Action to apply to some group of photos. Can I do this in Lightroom?

    IF you create a droplet you can drag the files directly from the Library Module on to it (Mac)
    If part of your process involves making derivative files from Raw then you can specify in the export dialog to run the droplet after processing.

  • CS3: Tools Photoshop Batch does nothing

    I select a bunch of found files and go to Tools > Photoshop > Batch. This used to present the Batch dialogue in Photoshop allowing me to run a batch action on the found files. Now it does nothing. Photoshop is running, computer recently restarted.

    >Update: Computer's hard drive recently replaced from a freshly formatted image. Still no joy.
    Meaning what exactly? I don't understand this way, what is "replaced from a freshly formatted image"
    And could you tell more details about OS and software version's
    Have you already tried to refresh preferences for Bridge?

Maybe you are looking for

  • Google calendar in ical iPhone

    So I made a google calendar with my work email. I have it synced with my mac but I can't get it to show up on my iphone. In Ical on my mac, I added the calendar in preferences but on my phone it won't accept a non-google email. I am hoping i am missi

  • Unable to format / partition hard disk

    First start with some up front info: - This all started when the partition table on my SSD became corrupt out of no where (the result of a system freeze) - I am using a 3rd party SSD from crucial (The M4) - I have tried formatting it by using a USB c

  • Sub contracot vendor open and close balance

    Dear expert Here I want to see opening and closing balance of subcontract vendor. In MB5B can see only our plant closing and opening stock. Any standard T-Code is available to see opening and closing stock of subcontract vendor? Please suggest Regard

  • Disoverer Business Area and Timestamp

    I'm using BI Discoverer 10.1.2.1 and when I create a new business area any Timestamp fields are not imported. They are just not there. I switched one field to a Date and it imported fine. Is it the case that BI Discoverer 10.1.2.1 can't cope with Tim

  • Can volatile variable be called as static variable for threads?

    I am trying to understand volatile variable, and it's uses. I was thinking of using it to make it shared variable between threads, but not between object instances. public class VolatileExample extends Thread {   volatile int x = 1;   public void f()