Hi,
i would like to write a applescript which can copy all the files from CD-ROM to hard disk when i run it.
but i don’t have idea on how to do it…
anyone willing to give me advice and guidiance?
i appreaciate your help…thanks
Hi,
i would like to write a applescript which can copy all the files from CD-ROM to hard disk when i run it.
but i don’t have idea on how to do it…
anyone willing to give me advice and guidiance?
i appreaciate your help…thanks
I havedn’t tried this with a cd - but it should work.
set this_folder to (choose folder with prompt "Pick the folder to copy:")
set dest_folder to (choose folder with prompt "Pick the destination:")
tell application "Finder" to duplicate this_folder to dest_folder
thanks…
what i understand from the code above is i need to select a source folder and a destination folder when prompt.
How about if i just want to copy all the files and folders in a CD-ROM instead of let me choose which folder to copy from?
then simply choose the cd-rom from the dialog box
i understand…
but i don’t want to let user choose the folder to copy from…because i want to restrict just to copy from CD-ROM to hard disk. Of course, user can’t select other source instead of CD-ROM.
so, i hope i can disable the prompt dialog box for source but remain the prompt dialog box for destination…but i don’t know how to modify the above code…what should i put inside the “set this_folder to”
set this_folder to ()
thanks…
ok - well if you just want to copy a particular cd-rom - AND want to restrict the user to CD-Roms only - you would have to do this:
tell application "Finder"
try
set theCDRom to "Macintosh HD:Volumes:nameofcdrom" as alias
on error
display dialog "There is no CD named [ nameofcdrom ] in this computer" buttons "Cancel"
end try
set dest_folder to (choose folder with prompt "Pick the destination:")
duplicate theCDRom to dest_folder
end tell
Then just change “Macintosh HD:Volumes:nameofcdrom” to the name of the cd-rom
The problem with this is that if you hard-code the name of the cd-rom - the cd HAS to be named that. If the cd will always be the same name - then problem solved…but if it isn’t you’re going to have to go about this a differnt way. I don’t know of any way to just get a list of removeable media that is mounted, such as cd-roms, etc… except to get all “disks” then parse out startup disk, network, etc…