Re: A little help with a folder cleanup script
Re: A little help with a folder cleanup script
- Subject: Re: A little help with a folder cleanup script
- From: dev_sleidy <email@hidden>
- Date: Wed, 9 Aug 2006 04:38:52 -0400
A few years ago ...
on open these_items
repeat with this_item in these_items
...
end repeat
end open
... which can be rewritten as:
on open these_items
tell application "Finder"
activate
repeat with this_item in these_items
open this_item
if (not (exists (folder "Documents" of this_item))) then move
(items of window 1 whose name is not ("Documents")) to folder
"Documents" of this_item with replacing
close this_item
end repeat
end tell
end open
This year I want to ... to leave a list of folders alone and move
everything else into the documents folder.
Here are two (2) solutions:
on open (these_items)
tell application "Finder"
activate
repeat with this_item in these_items
open this_item
if (not (exists (folder "Documents" of this_item))) then make new
folder at this_item with properties {name:"Documents"}
move (items of window 1 whose name is not in {"Desktop",
"Documents", "Downloads", "Library", "Movies", "Music", "Pictures",
"profile", "Public", "Roaming Media", "Sites"}) to folder "Documents"
of this_item with replacing
close this_item
end repeat
end tell
end open
... or (since there is no real need to open a folder, just to handle
items within it) ...
on open (these_items)
tell application "Finder"
activate
repeat with this_item in these_items
if (not (exists (folder "Documents" of this_item))) then make new
folder at this_item with properties {name:"Documents"}
move (items of this_item whose name is not in {"Desktop",
"Documents", "Downloads", "Library", "Movies", "Music", "Pictures",
"profile", "Public", "Roaming Media", "Sites"}) to folder "Documents"
of this_item with replacing
end repeat
end tell
end open
_______________________________________________
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