A little help with a folder cleanup script
A little help with a folder cleanup script
- Subject: A little help with a folder cleanup script
- From: Rick Davis <email@hidden>
- Date: Tue, 8 Aug 2006 23:04:10 -0400
A few years ago I used the following script to prepare home
directories for a move from an ASIP/At Ease server to an OS X/
Macintosh Manager/WorkGroup Manager server. I used Stewart
Macdonald's FileBlaster to delete items I knew I didn't want to keep
and then this script to move the rest:
on open these_items
repeat with this_item in these_items
tell application "Finder"
activate
tell application "Finder" to open this_item
if exists (folder "Documents" of this_item) then
select (items of window 1 whose name is not ("Documents"))
move selection to folder "Documents" of this_item with replacing
close this_item
else
make new folder at this_item with properties {name:"Documents"}
select (items of window 1 whose name is not ("Documents"))
move selection to folder "Documents" of this_item with replacing
close this_item
end if
end tell
end repeat
end open
This year I want to clean up last years network home directories to
prepare for a new year. But I want to leave a list of folders alone
and move everything else into the documents folder.
This is the list of allowed folders:
Desktop
Documents
Downloads
Library
Movies
Music
Pictures
profile
Public
Roaming Media
Sites
Last years users were allowed to create folders and save files
outside of their usual locations (made syncing a nightmare). I want
the script to move any folders that are not in the above list into
the Documents folder. I can get the above applescript to move
everything into the Documents folder, but choking on getting the "not
equal to" list into the script. I think a shell script might be
easier, but my shell script skills are even more limited. Any
scripting gurus willing to help?
Any and all suggestions greatly appreciated.
Rick Davis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden