If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Welcome to Mac-Forums! Join us to comment and to customize your site experience! Members have access to different forum appearance options, and many more functions.

I have'nt done much with Automator myself, but I do believe you can run Applescripts in Automator workflows, and there is a Unix command line utility called "md5" that returns a checksum on any files or folders supplied to it, if you open up the Terminal app and type this into the command line followed by the return key.

Code:

md5 (yourFileName.txt)

this will return the checksum for the file if it is a valid file path, for more info on the md5 command, type this into the terminal.

Code:

man md5

this will return the manual for the md5 utility, I dont know if the same utility can be used for drive paths as well, or if there is another command line tool for your purposes, you may have to check that with one of the Unix tools websites.

If you do know any Applescript coding, then you can design a Applescript droplet that runs a shell script command to the md5 utility, when a file or folder or drive is dropped onto your droplet application, for example.

Code:

on run
set filePath to POSIX path of (path to documents folder) & "MyTextFile.txt" as text
set theResult to do shell script "md5" & space & quoted form of filePath
return theResult
end run

This will return the checksum result on a file called MyTextFile.txt in your Documents folder.
If you put this code into a on open handler instead of an on run handler, then it will return the same result when files are dropped onto your compiled droplet application.

Like Automator, I dont know a lot of Applescript, but I always go to the MacScripter forums for help with my scripts, there are some really smart and knowledgable guys over there, that could probably come up a a trick Applescript solution for you.

What I have created right now is an Automator Service. The Service is selected for Files and Folders with the Application Finder. I then have a Shell Script with the following code:

find $1 $2 $3 $4 $5 -type f -exec md5 -r "{}" \; > $1/../DRIVE.md5

What this allows me to do is select multiple folders at a time, right click and select my service and then it creates an MD5 file on the Parent Directory. Unfortunately, I would like to be able to right click on a hard drive, select the service and it generate an MD5 file of the entire hard drive, with the MD5 file saving on the hard drive.

I have been able to use the code via Terminal by using "cd" and selecting the drive path and then pasting in the code, but I would like to skip the whole process of doing this via Terminal. Maybe the Automator Service is in correct and there can be a better way to do this? I've really new to scripting and have had help from others creating this code but no success yet at doing what I would want it to be doing.