I don't know how to proceed to set up an apple script which moves folders with their content to a new loacation, where these folders migth already exist. If so Finder should overwrite these folders. But in the same process I have specific files, too, which should be moved to a new location. I don't get it how to make it work.
These are the files and folders I want to move and overwrite: OLDFOLDER > source, which should be overwriten with destination > NEWFOLDER
folders
folders
documents (without ending)
documents (with ending)
I would appreciate any help which gives a direection how to realize this. I tried some research before, but did not get ahead...
Best
Thanx to @wch1zpink
I got the necessary script to work with some improvements for my case. Here is how it works, now:
-- Set The Variables To Program Netshare Folder Locations
set NetsharePath to "Macintosh HD:Volumes:Netshare:Maxon:"
set NetshareFolderOrigin to NetsharePath & "19.044_RB221380"
set NetshareFolderDestination to NetsharePath & "Testfolder"
-- (path to desktop as text) & "New_Location"
set NetshareFoldersToMove to {":library:scripts", ":Off_Plugins", ":plugins"}
set NetshareSubfolderDestination to {":library", "", ""}
-- Move Netshare Folders To New Folders
tell application "Finder"
repeat with i from 1 to number of items in NetshareFoldersToMove
set folderToBeMoved to NetshareFolderOrigin & item i of NetshareFoldersToMove
set NetshareFolderDestinationCombination to NetshareFolderDestination & item i of NetshareSubfolderDestination
set netMoveFolder to move folder folderToBeMoved ¬
to NetshareDestinationFolderCombination ¬
with replacing
-- duplicate folderToBeMoved to NetshareFolderDestinationCombination
end repeat
end tell
-- Set The Variables To Preferences Folder Locations
set Username to "USER"
set PreferencesPath to "Macintosh HD:Users:" & Username & ":Library:Preferences:Maxon:"
set PreferencesFolderOriginName to "19.044_RB221380_FDCD4BE0"
set PreferencesFolderDestinationName to "Test"
set PreferencesPathOrigin to PreferencesPath & PreferencesFolderOriginName
set PreferencesPathDestination to PreferencesPath & PreferencesFolderDestinationName
set PreferencesFoldersToMove to {":_bugreports", ":bug.html", ":library:browser", ":library:layout", ":prefs:cache", ":prefs:directorycache",":prefs:c4d_M_GLOBAL_POPUP.res", ":prefs:CINEMA 4D.prf", ":prefs:shortcuttable.res", ":prefs:template.l4d", ":prefs:template.prf"}
set PreferencesSubfolderDestination to {"", "", ":library", ":library", ":prefs", ":prefs", ":prefs", ":prefs", ":prefs", ":prefs", ":prefs"}
-- Move Preferences Folders To new Folders
tell application "Finder"
repeat with i from 1 to number of items in PreferencesFoldersToMove
set prefFolderToBeMoved to PreferencesPathOrigin & item i of PreferencesFoldersToMove
set PreferencesDestinationFolderCombination to PreferencesPathDestination & item i of PreferencesSubfolderDestination
set prefMoveFolder to move folder prefFolderToBeMoved ¬
to PreferencesDestinationFolderCombination ¬
with replacing
-- duplicate prefFolderToBeMoved to PreferencesDestinationFolderCombination
end repeat
end tell