Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Action Overwrites Files - help!

Community Beginner ,
Nov 07, 2019 Nov 07, 2019

I have an Action that does what I want - flip, rotate and save a selection to a folder. However, the action keeps overwriting previous files. I just want them all saved and and named sequentially. I would love suggestions on how to do this or if actions cannot do this other ways that can. Thanks!

TOPICS
Actions and scripting
11.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Explorer , Mar 01, 2022 Mar 01, 2022

Hi,

I have solved the problem by pasting the exact name of the file I am working on during the recording of the action.

Let me explain: I copy the name of the file, then, in Photoshop, I open the file, I record the action and just before clicking the "save" button (export > save for web") I paste the file name and then I click save. See the attached files, these are taken from some actions I have written. I don't know why, but if I find the "custom name" written, the action keeps writing over the

...
Translate
Community Expert , Dec 24, 2023 Dec 24, 2023

When you record the action, make sure the file name is not highlighted in blue. If it is, the file name is recoreded in the action and will overwrite. If it is not highlighted, the name is not recorded, and will not overwrite.

 

To un-highlight, it is usually enough to just click away from the path and back again.

Translate
Adobe
LEGEND ,
Nov 07, 2019 Nov 07, 2019

Are you creating new files or modifying existing files? You may need to add a script to change file names as you go.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2019 Nov 07, 2019

I want new files of a copy of an object from a larger "source" image.  My Action copies, rotates, flips, and resizes just as I want.  But when I go to the next object of interest and run the Action - it overwrites the previous 8 images I created.  I would be happy with these images just to default to a sequential name or anything really that does not overwrite.  That is where I am stuck --  thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2019 Nov 07, 2019

You probably have hardcoded file name and photohop is always saving file with the same name what is causing to overwrite existing file. Can you expand step to save and post screenshot? Or upload action somewhere and post link so we can examine and modify it if necessary.

Below is screenshot with the difference, second action will always overwrite existing file and you will always end up with single file in your batch process.

hard coded name in action.pngexpand image

In my opinion your best option is to download and use Image Processor Pro https://sourceforge.net/projects/ps-scripts/files/Image%20Processor%20Pro/v3_2%20betas/ which is free and to avoid save step because you can save images using interface in Image Processor Pro.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2019 Nov 07, 2019
 

Agreed - I have hard coded the names in my Action.  I didn't see how not or force it to default to sequential name.  I wish there was a character I could put before the extenstion name that did this renaming with no overwriting.  But I couldn't find a way to force that.  Here is my Action:  https://www.dropbox.com/s/ji3l4a60hlo1o66/Set%201.atn?dl=0  Really appreciate this.  While I have been stymied I have tried to get Apple Script and Automator to do this within Apples Preview - with no luck.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2019 Nov 07, 2019

I have IPP, tried to run my Action within that - but the overwrites still occur.  My sense is that I need to get Save As right in the Action.  See my post below.  And THANK YOU!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2019 Nov 07, 2019

Then you need to recode a Save As step for  some image file type like jpeg that only records the destination folder in the action step no file name so the step will default the file name to the current documents name. You can batch that action and override the destination folder using options.  If you expand your actions save as step so you can reads the settings recorded  you will see it has a file name and extension recorded into the step's settings. You do not want that. Do not set the file name when you record the step.  Do not alter the file names field in the save as dialog.  If you do that will be recorder into the action step.  You want the step recorded with no file name set just the folder set like the action:

image.pngexpand image

 

Actions you use with the Image Processor and Image Processor Pro need no Save steps saving files types is a function these scripts provide. The actions should not have save steps.

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2019 Nov 07, 2019

Easy solution to use action as it is: use File > Automate > Batch instead of Image Processor Pro. You must correct one mistake: you have Copy step at the begining of action and it is causing error message. Record step like Select > All before copy step in order to make action work or exclude first three steps which are not necessary for action to work and deliver what you need as end result. You will see during batch process several Save dialogues where you can name your files as you want. 

By the way, you can make things to work and using IPP but that will require to split your action into several actions and to avoid save step in your action plus to correct problem with Copy step / exlude it from action along with next two steps, too complicated I think.

Here is how your Batch dialogue should look like:

batch process dialog.pngexpand image

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2019 Nov 07, 2019

Thank you and JJ.  I am learning Actions and related things as I try and solve this problem.  I do so appreciate your kind patience.

 

JJ - It behaves such that it makes me select a name.  I tried leaving that blank and would not progress.

Bojan - The copy step is key - that is where I copy my objects selected from my large source image.

 

I want to just drag my selection through the image over my ROI, hit F13, have the 8 images that my Action creates saved, drag to another ROI, hit F13 and have those 8 images saved with no overwrites.  I am building a CNN to identify birds and the CNN likes as many instances of the objects to be found - hence my flipping and rotating.  I may add other image mods to my action but for now I am happy with just the 8.  I can do more later using batch or other automation.  My source image is 33,000 by 12,000 and contains around 700 birds that I want to turn into 700x8 birds in one folder to use to train my CNN.  Finder can rename images nicely and sequentially but I cannot get it to do that as files come into the folder from PS Actions.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2019 Nov 07, 2019

Easy solution, again: Save steps can save each version in separate folder with no overwrites, are you aware of that? I mean you can create 8 folders on your drives and record 8 Save steps to save files one after another in different folders with file named after document name. Is that OK for you? Later rename and merge files if you need that step for what you can use Bridge to automate that process. You will need to re-record Save steps.

If you want to keep Copy step then record step to create selection before it.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2019 Nov 07, 2019

Thank you again.  I feel I will get there....  I saw and I am aware that I could send the files to separate folders but I would rather avoid that and in any case, wouldn't items sent to those folders overwrite after the initial 8 files are written to them? Anyway, I would just like an action or another approach that gives a unique name to each new file.  Thanks!!

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2019 Nov 07, 2019

in any case, wouldn't items sent to those folders overwrite after the initial 8 files are written to them?

No, if you record Save step properly without even touching File name: field in Save As dialog when saving file. When playing such step it will save file with current document name. Your documents has different names so it won't overwrite each other.

You can as already mentioned use Image Processor Pro for automation and to save 8 separate files and add prefix or suffix for easier recognition or to use document name plus sequence number, for example. Here is my tutorial which may help you in that job https://www.designeasy.co/2014/07/how-to-add-prefix-and-suffix-to-file.html Ask any additional question if you have problem. For this to work you must split your action into 8 different smaller actions and to exclude save step. Each action should be included to play with each save. It requires additional work what may not be what you want to deal with.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2019 Nov 07, 2019

Okay, thank you.  Here is what I have done and here is my question:

 

What I have done:  Using my current Action that gives me the 8 files I want when hitting F13 I have writen a Folder Action with Automator (on a Mac) that when I run it, it opens my folder, selects all, and renames them sequentially.  In this way it allows me to go back to PS, select a new region, export my 8 and Run my Renamer Folder Action I created.  So, I have what I want by going back and forth between PS and Renamer and it is a two step work flow.  

 

My Question:  Is there anyway to do this in a single step all from within PS with a single F key?  Or, will the best PS solution using IPP result in a second step?  I looked over your tutorial and watched Russell's IPP video and both look like they will add at least one or more steps.  Thanks so very much!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2019 Nov 07, 2019

Here is a link to a screen video capture of my workflow using Automator and Folder Actions.  I hit F13 in PS to create my 8 images, and I hit Run in my Folder action window and the renaming does what I want.  By the time it renames, I have slected my next bird in the image.  I can live with this I suppose, but wish it all happended when I hit F13 in PS.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2019 Nov 07, 2019

I am not sure that I fully understand what you want to ask, here is my best try at the moment: Photoshop action can not do anything outside of Photoshop. Perhaps you can do full automation as you working right now but using javascript, not actions. I am not script guy and I can not help you in that task.

There is perhaps solution using actions and IPP but you must be clever and I can not check everything right now. The idea is to record action which will copy selection, create new and save file in particular folder then run IPP to use that file to create 8 files which you need. That is idea, no guaranty it can work fully automated because I can not check right now.

Another option to check is File > Automate > Batch script which offers file renaming option using serial numbers and some other renaming options. Idea: copy selection, create new document, paste then run Batch script which can run action and overwrite Save step to rename files. You can also use modal control to pause step with Batch script to make changes in that dialogue as necessary.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 07, 2019 Nov 07, 2019

I was not clear, sorry.  I have this down to 2 clicks - first is F13 to generate my 8 images, the second is Run in a folder action taht renames the file.  If I could get all this done in F13 I would be happier.  That is all I meant.  For now, I have a workflow I can live with and it actually gives me control over the naming of files.  For now, I think we can close this item...much obliged to everyone who weighed in on this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 01, 2022 Mar 01, 2022

Hi,

I have solved the problem by pasting the exact name of the file I am working on during the recording of the action.

Let me explain: I copy the name of the file, then, in Photoshop, I open the file, I record the action and just before clicking the "save" button (export > save for web") I paste the file name and then I click save. See the attached files, these are taken from some actions I have written. I don't know why, but if I find the "custom name" written, the action keeps writing over the same file.

I hope I am clear enough and I hope this could be useful for someone! Peace on earth!

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 07, 2023 Apr 07, 2023

I wish people would admit that this is a glitch, a known error, and try to escalate so it gets fixed instead of just trying to post other programs you should use to get around this.  Ive been hunting for FIXES and all the mods just keep acting like they have no clue what it is and post alternate program workarounds.  Adobe, just fix it.  I had a whole project, 85 photos, multiple actions run, many many layers, and at the end, I just needed it to save the image in a new folder and close the original images, no need to save. Took about 3 hours to run the actions, get done, look in new folder, 1 image...  I would 100% understand (maybe) if I had typed in a custom name, but an "Action" esp a "Batch Action" should not be only useable on a single file ever.

Thanks @GNBeraldo for at least posting a decent workaround.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2023 Apr 07, 2023
quote

I wish people would admit that this is a glitch, a known error, and try to escalate so it gets fixed instead of just trying to post other programs you should use to get around this.


By Crispix396

 

I am not aware of any known bug. This is a known error - user error. An action can either be recorded with a save path and filename - or only save path.

 

If you believe this to be a bug, posting your OS and version/build of Photoshop would be helpful to see if this can be reproduced.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 07, 2023 Apr 07, 2023

Well, I tried it..  Same issue. Whether I copy the name and paste it, or whether I just hit "save a copy - jpg" it still renames every single image with the same name.  I cannot figure out how you got the "file name" to not show up in the action.

Tried leaving the folder, going back in and hitting ok - same
Tried the copy name/ paste name.. same

This is so frustrating.  Personally, my 'save' action is a simple "opened files" "Save As" with copy/with lowercase

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2023 Apr 07, 2023

@Crispix396 â€“ The issue clearly indicated in your screenshot is a common user error, you have recorded an explicit filename in your action.

 

One can't change the filename when recording. All you have to do is navigate to the save folder and press OK. This is a common problem, probably covered hundreds of times on the forum.

 

Note the difference in the following screenshot:

 

atn.pngexpand image

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2023 Apr 10, 2023

I realize you aren't seeing. E do this.. I am not typing in an 'explicit file name'.. I'm not touching anything there. 

 

Literally the action record process is 'save as' - change extension to jpg - save. 

 

What other magic are you suggesting is done? 

 

I said in my post I understand if I were typing in 'special name 1' 5hat it would try and name them all the name I typed.. Not the case. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2023 Apr 10, 2023

Sample given using export paths to illustrator

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2023 Apr 10, 2023
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 10, 2023 Apr 10, 2023

Feel free to tell me where the "common user error" is..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines