Does anyone have an Applescript Application to drag and drop a hard drive and it generate a MD5 Checksum text file and place it on the hard drive? I currently can do this via Terminal but would like to Automate this more.
Thanks!
Does anyone have an Applescript Application to drag and drop a hard drive and it generate a MD5 Checksum text file and place it on the hard drive? I currently can do this via Terminal but would like to Automate this more.
Thanks!
Hello and good day,
Would you be more specific about the drag and drop,
Do you want a window where you can drop the hdd, or do you want to be able do drop the hdd on the icon of the application.
Because the first option is only do-able with xcode and the second option can be done using just applescript editor.
Since you post this in the applescript forum, I think you mean the second option. but just to be sure.
All I can think of is:
do shell script "md5 /dev/[diskid]" -- replade [diskid] with the id of the disk as reported by Terminal command "mount"
But there are two problems:
Hope this helps.
Fun fact! The MD5 of /dev/null is d41d8cd98f00b204e9800998ecf8427e.
Sorry, I should have been more specific in the first place!
Drag-and-drop should be to Drag-and-Drop the Mounted External Hard Drive onto an Applescript Application and then it generates an MD5 Text File based off of all the Files/Folders on the Hard Drive. At the end of the process, the MD5 Text file is saved onto the Hard Drive.
Currently, I can go into terminal and enter cd “drag hard drive onto terminal window” press enter to change the directory to the hard drive, and then I enter this code:
find * -type f -exec md5 -r “{}” ; > DRIVE.md5
and what this does it generates a MD5 Text File called “Drive.md5” with all the hashes and is saved on the directory. It would be wonderful to have this process automated with an Applescript Application to simply drag-and-drop the external drive onto the application and it does all the nitty gritty!
Thank you for all your help!
I haven’t had any success.
I guess my script is fine when Changing the Directory in Terminal to the Hard Drive and then running it. So, maybe I should be asking if there is a way to run an Applescript to Change Directory to a hard drive dropped onto the Applescript application and then run the script I have used previously to generate MD5 files.
Thanks
You can try something like this:
on open aDisk
set xxx to "cd " & quoted form of (POSIX path of aDisk) & " ; find * -type f -exec md5 -r {} \\; > DRIVE.md5"
do shell script xxx
beep
end open
Thank you! that does exactly what I’m looking for!
Now, all I have to do is figure out how to script a progress bar in there and I’m golden!
Thank you once again, it is working flawlessly!
I am glad it worked for you. Check out ASObjC Runner for a progress bar: http://www.macosxautomation.com/applescript/apps/runner_vanilla.html