Hi folks,
I’m new here, but have written some scripts (read “adopted Apple’s sample scripts”). I’ve tried to find a ready-made solution or a thread on this, with no sucess, so if somebody know where I can look, or know about a solution, I’d really appreciate it.
At my job we have some thousands of images with filenames in the style
I_6361_005_0702.ai or I_005_0702.ai
<pubnumber 4 digits><running number 3 digits>_.
Prefix is either I, PP or PH, pubnumber is always 4 digits, running number always 3 digits. extension is either ai or psd
For various reasons we need to change them, either one by one as we edit them anyway, or in folder batches. In both cases by a droplet or app. We are not going to do them all at once, so leftovers can be caught just by looking into the output folder.
We are looking for the following patterns:
I_6361_005_0702.ai → 0702 005 6361.ai
I_6361_005_0702a.ai → 0702 005 6361 a.ai (1-3 letters)
I_005_0702.ai → 0702 005.ai
I_97568.ai → 97568.ai (that’s a simple one)
PH_12.234_98568.psd → 12.234 98568.psd (1-3 digits around the .)
Best, Boris