I have now tried several applescripts and automator and shell to try and achieve this with no luck.
Would like to copy the contents of .img files to the same folder where the .img file is stored.
Could be done with automator (watch folder that triggers the script)
Most scripts out there assume that I know the name of the disc image, wich I don’t.
Asked for help in another tread http://macscripter.net/viewtopic.php?id=44587 but that does not work, even though I have tried to modify it.
Something like this is what I would like to achive but with disc images in .img format:
(Almost impossible to google this and find anything. Maybe it aint doable?
set diskName to cdDVDName()
if diskName is missing value then error "Could not get the name of the inserted disk"
diskName
on cdDVDName()
set diskName to missing value
try
set theConst to "Volume Name: "
set drutilStatus to do shell script "drutil status -drive internal | grep \"/dev/\""
set theDrive to "/dev/" & item -1 of (words of drutilStatus)
set diskutilInfo to do shell script "diskutil info " & theDrive & " | grep \"" & theConst & "\""
set text item delimiters to theConst
set a to text items of diskutilInfo
set text item delimiters to ""
set diskName to item -1 of a
repeat while diskName begins with space
set diskName to text 2 thru -1 of diskName
end repeat
repeat while diskName ends with space
set diskName to text 1 thru -2 of diskName
end repeat
end try
return diskName
end cdDVDName