Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How to cut and paste files, merge folders' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to cut and paste files, merge folders
Authored by: llee on Jul 01, '10 11:54:52AM

OK, that's the same action I get with Overlay (http://lonestar.utsa.edu/llee/applescript/overlay.html)

Here's the version I'm using now with Snow Leopard. This one is configured for use with OS X's built-in tar, but it can be used with Helios Xtar also.

----- begin Applescript -----
property the_src_choice : ""
property the_dest_choice : ""
property startnum : 0
property newline : ASCII character 10
property tmpfile : "/tmp/execme.command"

tell application "Finder" to set the the_items to (((folder of the front window) as alias) as list)
set the_dest_choice to (choose folder with prompt "Choose the destination folder or volume.")
my tarcopy(the_items)

on open the_items
set the_dest_choice to (choose folder with prompt "Choose the destination folder or volume.")
my tarcopy(the_items)
end open

on tarcopy(the_items)
set pos_dest to POSIX path of the_dest_choice
tell application "Finder"
set the_src_choice to (item 1 of the_items)
set disksrc to (get disk of the_src_choice)
set srcdiskname to ((characters 1 thru -2 of (disksrc as string)) as string)
try
set ignore privileges of disk srcdiskname to false
end try
set diskspec to (get disk of the_dest_choice)
set diskname to ((characters 1 thru -2 of (diskspec as string)) as string)
try
set ignore privileges of disk diskname to false
end try
end tell

set f to "/usr/bin/"
set c to f & "tar"
set pos_c to POSIX path of c
set the_source to POSIX path of the_src_choice

set theShellScript to "sudo umask 0" & ";" & "(cd" & space & (quoted form of the_source) & ";" & ("sudo" & space & pos_c & space & "clbf 1024 - .)") & space & "|" & space & "(cd" & space & (quoted form of pos_dest) & ";" & ("sudo" & space & pos_c & space & "xbf 1024 -);rm" & space & tmpfile)

do shell script "echo " & quoted form of theShellScript & " > " & tmpfile
repeat
try
do shell script "chmod +x " & tmpfile
do shell script "open -a Terminal.app" & space & tmpfile
exit repeat
on error
delay 1
end try
end repeat
end tarcopy
----- end Applescript -----



[ Reply to This | # ]