This came up a few weeks ago. The following only works in CS which caused a bit of confusion when I posted it last.
In the Batch dialog box, choose Save and Close as your Destination, tick Include Subfolders and Override Action Save As Commands. You must have a Save As in the action of course to do what you want to do but ticking that box will cause the action to ignore the destination from the action and just save them in the same folder as the files are in.
The benefit of the CS solution Mick noted is that it works with multiple source folders, e.g., when the ‘subfolders’ option is selected. FWIW: The Source folder can contain physical folders or aliases that point to folders located elsewhere.
For those who don’t have CS yet, you can change file format and save reformatted files to a single folder, including the original folder, by making these settings in the Batch dialog:
* Destination: Folder. Choose (and browse to Source folder) * Turn on the "Override Action "Save as" commands" option as Mick said.
BTW: Be sure your action does not include an Open command or if it does either disable it in the action or check the "Override Action ‘Open’ commands" option.
Mick & Danny,
Thank you both. I tried to explain that I do know how to do it with batch automation, PS 7 or 8.
The problem is with opened images and action run. Unless you set a dialogue, this will try to save in the folder that was active when the action was created. Even if that folder no longer exists. The action does a lot of other stuff. The dialogue is a real pain.
Cheers, Rags 🙂
Saw "I can override the target directory in the batch automation" and ass-u-me-d you wanted to do this in batch. Sorry about that.
Before making any more wrong assumptions, describe your workflow, e.g., how do the images get into the PS window? Do you manually open them via File > Open? Import several from a scanner or digital camera?
Does the action change file format, e.g., you start with (say) .psd and you save as .jpg (or something like that) or are you just saving a modified image over its original?
"…save the new image in the current folder" can be interpreted differently by different people. What’s your definition of "current folder"? The one from which the last image was opened or something else?
This info will help.
AH! Once again I read too fast for my own good. Apologies Rags. Offhand I don’t know any way to do this through an action. However it is possible with a very simple JavaScript which you could assign a keyboard shortcut to. If you just want to overwrite a file without changing file formats do the following:
Open notepad and copy the following single line of code. It’s case sensitive.
app.activeDocument.close(SaveOptions.SAVECHANGES)
Then save it as whateveryoulike.js (make sure it’s .js) and put it in C:\Program Files\Adobe\Photoshop CS\Presets\Scripts (make sure PS is not running). Then start PS and it will appear in your scripts menu and assign a keyboard shortcut.
Sorry, misreading again. I’ve got to slow down. That will save the file to its original folder. It needs a line or two added to get the current path. Offhand I don’t know the JavaScript for this (I use VB but that will not allow you to set a shortcut key as it has to be run from outside PS) although it is undoubtedly very simple. If you ask this in the scripting forum, I’m sure somebody will help.
Mick:
While you’re "slowing down" :), how would you define "current folder" (or path) in the PS sense? If I opened two images via File > Open from different folders, would "current folder" be the last one?
I haven’t slowed down yet Danny but I would guess it is the directory of the most recently opened file. I’d have to check by testing it. In Visual Basic, there is a simple function CurDir which gives the path of the current directory and you would simply add that as a string to the file path with the file name when saving. I don’t know the equivalent in JavaScript and right now I haven’t got time to find out…. gasping for breath….. life’s so short…… toomuchtodo… whattzthecurrentdirectory……….. goodquestion……..
That was a great question Danny. Basically, the current directory would only have meaning in scripting if you also open the files through scripting (in VB at least). Otherwise the scripting interface has no idea what PS is doing. Afraid it’s back to square 1. Proceed to the scripting forum.