I’m trying to make a contextual menu Big Cat script that would make a disk imge from folder chosen in Finder.
I’ve problem with this line: do shell script “rm -r '” & dmgPath & “'”
If I add this line - nothing happens.
If I remove the line, I end up with the file named: My image_temp, which is not what I want.
I’m newbie in this do shell script department, so any help would be highly appreciated!
on main(TheFiles)
repeat with i in TheFiles
set ItemInfo to info for i
set folderName to name of ItemInfo
set theDestination to POSIX path of ?
(choose folder with prompt "Where do you want to save the disk images?")
set imageName to folderName & "_temp.dmg"
set theSource to POSIX path of i
set dmgPath to theDestination & imageName as string
set shellCommand to "hdiutil create -srcfolder '" & ?
theSource & "' -tgtimagekey zlib-level=9 '" & dmgPath & "'"
with timeout of 3600 seconds
do shell script shellCommand
do shell script "rm -r '" & dmgPath & "'"
end timeout
end repeat
end main