It's been a while since I needed to work on any of my scripts and I'm unfortunately pretty rusty.
I have a folder with as many as a few hundred sub folders all named like this: XXXXLABXX, where the first four characters are an item number. I need to file these in folders that either exist or don't without overwriting.
I want to scrape the first four characters of the folder name to be moved, find a matching folder in another directory (or create one if none exists), and then move the entire folder and its contents to the found or created location.
So far I have Folder.selectDialog for both origin and destination, but have had very little progress beyond that.
Example:
1234LAB56 folder > look for 1234 folder in destination, create if none > move 1234LAB56 folder to 1234 folder in destination. If 1234LAB56 already exists, ideally this would be reported at the end of the script so I can go in and manually move it.
Using 4 characters of folder name to move with contents
- jaydoubleyou80
- Posts: 21
- Joined: Mon Oct 17, 2016 1:41 pm
- Location: USA
Re: Using 4 characters of folder name to move with contents
Hey! Based on the example given, I think you're better off with doing this in eg. powershell or a .bat-script. Photoshop Javascript doesn't support moving of files & folders.