Howdy all,
If you recall my last project (The devhook one posted in the PPC vs Intel thread)… I spent some time trying to track down the bug, but with no luck. So I decided to start fresh, and this time, using AS Studio to make a GUI.
The learning curve hasn’t been too bad, (yet, anyways) and I’ve actually got a majority of my stuff working.
Here’s what I’m trying to do now, as a bit of a code improvement.
well… first… an example of the kind of file tree we’d be dealing with
and the memory stick we’d be transfering to would be /memstick/psp/game/ and /memstick/
Now, what I’d like to do is basically "Take everything except the readme from ‘myfolder’, and move it to the identical folders on memstick, but don’t replace any folders’.
Now, I could do this using several variables, but if there is any way to make it simpler, it would be appreciated.
Any suggustions? I think I explained that well enough…
-Parrot
By ‘don’t replace any folders’ do you mean merge the folders together, so that items in one folder get copied to the folder at the same point in the folder tree as the source. Are files allowed to be replaced in this situation?
basically, if I have my folder
and my memory stick
I would like to end up with
using as few variables/move statements as possible.
Coudl you take something like this and modify it? (Merge Folder 1.0.1)
-- Version 1.0.1
on run
choose folder with prompt "Get contents of these folders:" default location (path to home folder) ¬
with showing package contents and multiple selections allowed
open (result)
end run
on open droppedItems
choose folder with prompt "Merge into this folder:" default location (path to home folder) ¬
with showing package contents
set target to quoted form of POSIX path of result
display dialog "How to handle existing files?" buttons {"Overwrite", "Cancel", "Skip"} default button 3
if (button returned of result) is "Overwrite" then
set overwriteOption to "f"
else
set overwriteOption to "n"
end if
repeat with thisItem in droppedItems
if (folder of (info for thisItem without size)) is true then
get quoted form of POSIX path of thisItem
try
do shell script "cd " & result & "; /bin/cp -RP" & overwriteOption & " ./* " & target
on error errorMsg number errorNum
display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "OK" default button 1 with icon caution
end try
end if
end repeat
display dialog "Script finished." buttons "OK" default button 1 with icon note
end open