New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Create Automator Service to make MD5 Checksum of External Hard Drive


Post Reply New Thread Subscribe

 
Thread Tools
Eggers

 
Member Since: May 26, 2012
Posts: 2
Eggers is on a distinguished road

Eggers is offline
Hello,

Can someone help me make an Automator Service that will generate an MD5 Checksum of a Hard Drive just by Right Clicking the Drive and selecting the service? I'm new to this!

Thanks!
QUOTE Thanks
Mark FX

 
Mark FX's Avatar
 
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 168
Mark FX has a spectacular aura about

Mark FX is offline
Do you know any Applescript ?
QUOTE Thanks
Mark FX

 
Mark FX's Avatar
 
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 168
Mark FX has a spectacular aura about

Mark FX is offline
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.

MacScripter

Sorry I could not be more help.

Regards Mark
QUOTE Thanks
Eggers

 
Member Since: May 26, 2012
Posts: 2
Eggers is on a distinguished road

Eggers is offline
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.

Suggestions? Thanks for the help!
QUOTE Thanks

Post Reply New Thread Subscribe


« mac equivalent for flash/java ? | PLEASE HELP A gfortran NEWBIE... »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Swapping Hard drive with only a usb external exoticwelding OS X - Operating System 2 03-25-2012 11:35 PM
Time Machine Data on External Hard drive? AaronInKtown OS X - Operating System 2 03-25-2012 02:12 PM
How to: Upgrade Hard Drive 2009 Macbook Pro 13 s2odin Apple Notebooks 9 12-04-2010 01:06 PM
Did I make a good choice (external hard drive)? milk is white Other Hardware and Peripherals 2 11-13-2008 10:59 PM
Q950 Hard Drive & External Drive sniffy Other Hardware and Peripherals 0 01-29-2008 03:24 AM

All times are GMT -4. The time now is 09:44 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?