-- Create ISO Image from Folder.applescript -- Create ISO Image from Folder -- Created by LEGO Boy (lego@therac25.net) on Mon Aug 22 2005. -- Copyright (c) 2005 Ginko Studios. All rights reserved. on idle -- do nothing end idle on open droppedItems if the (count of droppedItems) is not 1 then tell application "Finder" display dialog "You dropped multiple items. Please drop a single folder to be turned into an ISO image" buttons {"OK"} default button "OK" with icon stop end tell tell me to quit else tell application "Finder" set srcFolder to item 1 of droppedItems -- it's an alias end tell tell application "Finder" if folder srcFolder exists then -- check the size of the folder. Inform the user if it's bigger than a CD -- (we'll use 621.3 MB - based in info of a mounted blank 650MB CD image) tell application "Finder" repeat try set droppedFolderSize to size of item srcFolder as integer if droppedFolderSize is greater than 6.51480268E+8 then display dialog "The selected folder's contents won't fit on a 650MB CD" buttons {"Big Deal"} default button "Big Deal" with icon caution end if exit repeat on error delay 1 end try end repeat end tell try display dialog "Enter the desired name of the output ISO file (it will be created in your home directory)" default answer "burnMe.iso" if button returned of result is "ok" then set outputImageName to the text returned of result end if on error tell me to quit return end try set destPath to (system attribute "HOME") & "/" --path to user do shell script "hdiutil makehybrid -iso -o " & quoted form of (destPath & outputImageName as string) & " " & quoted form of (POSIX path of srcFolder) display dialog "ISO image successfully created" buttons {"OK"} else display dialog "You dropped an item that is not a folder. Please drop a folder" buttons {"OK"} default button "OK" with icon stop tell me to quit end if --folder exists end tell end if --count > 1 quit end open