Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Login Script

Hi,

I'm new to the whole scripting thing, but I've been looking around and I've got a script to clean up a users desktop and move the files to relevant folders, e.g. Image files will go to the Pictures folder.

This is the script:

tell application "Finder"
set desktopFolder to (path to desktop folder)
set musicFolder to (path to music folder)
set appsFolder to (path to applications folder)
set picsFolder to (path to pictures folder)
set moviesFolder to (path to movies folder)
set docsfolder to (path to documents folder)

set musicExt to {".mp3", ".aac", ".aiff"}
set appsExt to {".dmg", ".sit", ".app"}
set picsExt to {".jpg", ".gif", ".tif", ".png", ".psd"}
set moviesExt to {".avi", ".mpg", ".mov", ".m4v"}
set docsExt to {".pdf", ".txt", ".doc", ".xls", ".key", ".pages", ".docx"}

set allFiles to files of desktopFolder
repeat with theFile in allFiles
copy name of theFile as string to FileName

repeat with ext in musicExt
if FileName ends with ext then
move theFile to musicFolder
end if
end repeat

repeat with ext in appsExt
if FileName ends with ext then
move theFile to appsFolder
end if
end repeat

repeat with ext in picsExt
if FileName ends with ext then
move theFile to picsFolder
end if
end repeat

repeat with ext in docsExt
if FileName ends with ext then
move theFile to docsfolder
end if
end repeat

repeat with ext in moviesExt
if FileName ends with ext then
move theFile to moviesFolder
end if
end repeat
end repeat
end tell

Anyway, what I am wanting to do is have this script run when a network user logs in (I work in a school and the kids love the drag and drop feature in order to save pictures from the internet, and the clutter is doing my nut!)

So can any one help me?

Also, I know this is probably the wrong place to ask this, but is there anyway I can just run a script which will just delete desktop clutter instead of 'Re-filing' them?

Cheers.

Nick

Mac OS X (10.6.6)

Posted on Feb 4, 2011 4:58 AM

Reply

There are no replies.

Login Script

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.