Re: cleaning my desktop
Re: cleaning my desktop
- Subject: Re: cleaning my desktop
- From: Peter Baxter <email@hidden>
- Date: Sat, 6 Oct 2007 16:36:40 +1000
Closer to a solution is below. The use of error handlers would be a
vital part of your final script if you don't want to copy files over
each other. I haven't got time to test this, but I think that this
script would not need the try statements to work properly. Good luck.
set the source_folder to path to desktop folder as alias
tell application "Finder"
set the item_list to desktop
set desktopFiles to every item of the desktop
repeat with i from 1 to number of items in the item_list
try
set this_item to item i of the item_list
end try
set myProperties to kind of this_item
if myProperties contains "Document" then
try
move item i to folder "Documents" of home with replacing
--> you will need an error system to ensure that you don't
replace newer versions of your files
end try
end if
if myProperties contains "Movie" then
try
move item i to folder "Movies" of home with replacing
end try
end if
if myProperties contains "Image" then
try
move item i to folder "Pictures" of home with replacing
end try
end if
if myProperties contains "Audio" then
try
move item i to folder "Music" of home with replacing
end try
end if
end repeat
end tell
Peter Baxter
email@hidden
"Never ask a man what computer he uses. If it's a Mac, he'll tell
you. If it's not, why embarrass him?" --Tom Clancy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden