Rename using md5

Post Reply
User avatar
Terkelsen
Advanced member
Posts: 302
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Rename using md5

Post by Terkelsen »

Does any of you have an idea on how to use the Rename-feature to rename a file using md5 conversion.
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Rename using md5

Post by dkelly »

Assuming you are running on OSX where 'md5' application is available your could use the following script expression.



Process.execute(new Array("md5", "-q", job.getPath()));

Process.stdout;
User avatar
Terkelsen
Advanced member
Posts: 302
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Rename using md5

Post by Terkelsen »

Hi Dwight,



You are right, that I'm usually on OSX but in this case I'm trying to help a costumer running Switch on Windows Server 2008. Do I understand you right that this makes a difference for the suggested script?
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Rename using md5

Post by dkelly »

The 'md5' utility ships with Mac OS X. It isn't available on Windows without installing something like this: http://www.fourmilab.ch/md5/



You would need to change the script to:



if (s.isMac())

Process.execute(new Array("md5", "-q", job.getPath()));

else

Process.execute(new Array("PathTomd5", "-n", job.getPath()));

Process.stdout;



Customize the path of md5 on Windows to location you installed it.
User avatar
Terkelsen
Advanced member
Posts: 302
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Rename using md5

Post by Terkelsen »

Hi Dwight

I've tested this on Mac OSX and it works just perfect.

For using it on Windows you suggest that I download and install "something like this" and then you supply a download link. The link refers to a PDF, an I'm not quite sure how I'm supposed to use that?
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Rename using md5

Post by dkelly »

Sorry, copy-n-paste error. I fixed the URL in original post.
Post Reply