Topic Options
#55196 - 08/23/17 05:24 PM Simple renaming process
IMDJBUZZ Offline
OL Newbie

Registered: 06/01/14
Posts: 13
Loc: London UK
I'm sure this is easy but I had a search of the forums and could not see what I wanted.

I need to be able to rename loads of .jpg files that look like this

original name
rubbishidonotneed-A1000.jpg

New name
A1000.jpg

essentially I just need everything to the right of the -

Sure this is easy, I can write the original name to job info/variable (%9) although this would only let me name the file as it was originally, pretty pointless, I have no data source as such just the original file name?

Thanks,

Top
#55198 - 08/24/17 02:52 AM Re: Simple renaming process [Re: IMDJBUZZ]
Hunt3r Offline
OL Newbie

Registered: 02/13/17
Posts: 13
Hi,

You can use a script like this. (JavaScript for example)

Code:
//Get filename from jobinfo
var filename = Watch.GetJobInfo(9);
//Remove unwanted part
filename = filename.split("-")[1];
//Save to jobinfo
Watch.SetJobInfo(9, filename);


But if you want to process thousands of files periodically, I would recommend to write the loop in script too (instead of folder capture), you can use "Scripting.FileSystemObject" to work with files. It is faster.

Top
#55200 - 08/24/17 08:17 AM Re: Simple renaming process [Re: IMDJBUZZ]
IMDJBUZZ Offline
OL Newbie

Registered: 06/01/14
Posts: 13
Loc: London UK
Hi Hunt3r,

That works like a treat! It's only 500 files per month so this method is great and still pretty quick!

Thanks,

Top