I was going to suggest an osascript like tell application "Finder" to clean up the desktop but ran into problems with the clean up verb with the desktop object... apparently it only works on windows :(. Here's a bunch of suggestions for scripts that could probably be turned into osascript arguments discussions.apple.com/thread/416256?start=0&tstart=0
–
nine9thsNov 16 '12 at 4:28

Using @Lauri Ranta's answer as a starting point, I put together this Applescript for Alfred:

on alfred_script(q)
set q to "" & q
if q is "kind" then
tell application "Finder" to clean up window of desktop by kind
else if q is "cdate" then
tell application "Finder" to clean up window of desktop by creation date
else if q is "mdate" then
tell application "Finder" to clean up window of desktop by modification date
else if q is "size" then
tell application "Finder" to clean up window of desktop by physical size
else if q is "label" then
tell application "Finder" to clean up window of desktop by label index
else
tell application "Finder" to clean up window of desktop by name
end if
end alfred_script

You can see the different parameters to change the order that you want in the script (and change them to something that makes better sense to you if you want).

To use it, open Alfred's Preferences -> Extensions and click the + button in the lower left. Choose AppleScript and enter a name for it. (I called mine 'Clean up desktop'.) Write a Title and a Keyword for the script, and then paste the code into the AppleScript field. Click Save and you should be good to go!

If you're using Alfred 2: open Alfred's Preferences -> Workflows and click the + button in the lower left. Choose Templates -> Essentials -> Keyword to AppleScript. Double-click the keyword node and set the keyword you want (I chose cdesk), Title and Subtext (here I listed the possible arguments: kind, cdate, mdate, size, label). Save the results and then edit the Run NSAppleScript node and paste the code and save.