Jump to content
CarlosNZ

DeskDrawer (Keep the clutter off your Desktop!) [Updated to 1.5]

Recommended Posts

NOTE: This workflow has not been updated to work with Alfred 3.0 and above, and is known to cause issues. Use at your own risk.

 

----

 

Keep all the miscellaneous crap off your Desktop by sweeping everything into a "DeskDrawer" folder, which is easily accessible from our good friend Alfred.

 

Download DeskDrawer v1.5

[updated 25 March 2014]

 

Okay, the idea is not completely original — I've used apps like DesktopTidy and Unclutter to achieve this, but it's amazing how simple it is to replicate the basic concept with an Alfred workflow.

 

screenshot20130130at122.png

This is your "DeskDrawer" in Alfred (keyword "drawer", default hotkey Shift-Cmd-D). From there you can:

  • search the list (just start typing)
  • open an item (select it)
  • move it back to your Desktop (option-select)
  • reveal it in DeskDrawer/Finder (cmd-select)
  • browse/open it in Alfred (ctrl-select) for further action.
  • Move item to the Trash (fn-select) [NEW in 1.3]

There is a file action, "Move to DeskDrawer" (as well as the  keyword "move") for quickly flicking items into the Drawer. There is also the keyword "sweep" to scoop all your Desktop items into DeskDrawer in one hit. And finally, "deskrestore" will dump the contents of your DeskDrawer back on the Desktop in all its messy glory.

 

You can also undo your last file/folder movement with the "unmove" keyword. [New in v1.5]

 

And now you can protect certain items on your Desktop from being moved during a sweep, with either the File Action "Protect from DeskDrawer Sweep" or the keyword "protect". (Reverse this with the File Action "UnProtect from DeskDrawer Sweep" or keyword "unprotect".) [New in v1.5]

 

And finally, for full documentation, use the keyword "deskdrawer help". [New in v1.5]

 

I don't about the rest of you, but I like to keep my Desktop as clutter-free as possible (unlike my IRL desktop! :rolleyes: ), so having this capability in Alfred is great.

 

Let me know what you think, or any bugs you find.

 

Features I'd still like to add:

  • The ability to "protect" certain files from the "sweep" and "deskrestore" actions. [DONE in v1.5]
  • Be able to specify the location of your DeskDrawer folder. [DONE in v1.2] B)
  • Any requests?

 

UPDATE:  1 April 2013 - v1.3

  • New action: "fn-select" item to Trash it.
  • Consolidated and tidied up workflow setup panel.
  • Support for Alleyoop auto-updater
  • Minor cosmetic tweaks.

UPDATE: 2 April 2013 - v1.4

  • New keyword: "move" — moves selected items to Drawer (same as the file action, but you just enter it in Alfred's main window — some people seem to prefer this approach.)

UPDATE: 25 March 2014 - v1.5

  • New icon for DeskDrawer folder (to fit in with OS X custom folder look).
  • DeskDrawer is now allowed on the Desktop itself.
  • “Undo” function to reverse the last “Move” to DeskDrawer or Sweep.
  • “Protect” specified Desktop items from being moved to the DeskDrawer during Sweeps.
  • Fix for XML-illegal characters in filenames.
  • More icons.
  • Removed AlleyOop updater support.
  • Default DeskDrawer location is now Home folder.
  • Local documentation (keyword: deskdrawer help)
  • Miscellaneous minor tweaks and fixes.
Edited by CarlosNZ
Added warning.

Share this post


Link to post

Features I'd like to add:

  • The ability to "protect" certain files from the "sweep" and "deskrestore" actions.
  • Be able to specify the location of your DeskDrawer folder.
  • Any requests?

 

Hi Carl - great idea; I can see this becoming a part of my daily flow as I already do similar but manually using standard Alfred file actions. Good template too for how to create a pretty comprehensive flow too.

 

My primary request would be the customisation of the DeskDrawer folder. The current location is not indexed by Alfred and so the contents won't show in regular searches - while I can update Alfred's search scope, I'd rather not have to, plus I could also host the folder via Dropbox to sync the data between machines.

 

In the short term, I guess I just need to update the includes.sh file and  "deskdrawer="$CDWD/DeskDrawer" variable to manually change location?

 

EDIT: Found that changing $deskdrawer works if I manually create the deskdrawer folder - the check for the folder existing, and creating if not, it needs to be updated. Otherwise seems to work fine

 

Thanks again - great flow

Share this post


Link to post
Hi Carl - great idea; I can see this becoming a part of my daily flow as I already do similar but manually using standard Alfred file actions. Good template too for how to create a pretty comprehensive flow too.

 

My primary request would be the customisation of the DeskDrawer folder. The current location is not indexed by Alfred and so the contents won't show in regular searches - while I can update Alfred's search scope, I'd rather not have to, plus I could also host the folder via Dropbox to sync the data between machines.

 

In the short term, I guess I just need to update the includes.sh file and  "deskdrawer="$CDWD/DeskDrawer" variable to manually change location?

 

EDIT: Found that changing $deskdrawer works if I manually create the deskdrawer folder - the check for the folder existing, and creating if not, it needs to be updated. Otherwise seems to work fine

 

Thanks again - great flow

Thanks for the feedback. Good point about the current location not being indexed by Alfred; I didn't think of that. So yeah, I'll make the ability to move the deskdrawer folder my No.1 priority. B)

 

Cheers.

Share this post


Link to post

v1.2 - Move your DeskDrawer!

 

Was fairly simple, because I was able to mostly just copy-paste what I needed from my Time&Date Strings workflow. Let me know how it goes for you. The default keyword to move your DeskDrawer is "movedrawer".

 

I would stress that you might want to check your files are backed up first. While I'm pretty confident it'll work just fine, and I've tested it thoroughly myself, I would hate for someone to lose something important just because I forgot to close a bracket somewhere. :huh:

Share this post


Link to post

Hi

 

I can't get the "movedrawer" function to work. I never get the path select dialog appear suggesting something is going wrong with calling the Applescript function.

 

I've manually updated the config file with a custom path and then all appears to work, so the basic feature of having a custom drawer appears fine, just not the workflow to define it. 

Share this post


Link to post
Hi

 

I can't get the "movedrawer" function to work. I never get the path select dialog appear suggesting something is going wrong with calling the Applescript function.

 

I've manually updated the config file with a custom path and then all appears to work, so the basic feature of having a custom drawer appears fine, just not the workflow to define it. 

What version of OS X are you using? I've had it working on both Lion and Mountain Lion for me.

Share this post


Link to post

Would you mind doing a check of something for me? Can you open up AppleScript Editor (Alfred will do it for you ;) ) and enter this script into a new document:

 

tell application "System Events"
	activate
	set folderName to POSIX path of (choose folder with prompt "Where would you like to store your DeskDrawer folder?")
end tell

Then try and "run" it and let me know if you get a path-choosing dialog prompt. Then I'll be able to tell if it's a problem with Applescript or with the way the bash shell calls said script. I suspect it will be the latter, but may as well check. Cheers.

Share this post


Link to post

Tried it while you were posting - works fine

How fishy. If you don't mind, I'll get you to try out one of my other workflows that has an AppleScript prompt and see if that works. I haven't published that update yet though, so I'll post back here tomorrow with the details.

Thanks heaps for helping troubleshoot. I'm glad you managed to manually make the changes anyway. :)

Share this post


Link to post

Permissions!

 

Checked out Time & Date code which was identical, but that function worked fine. So had to be a difference between setups for the 2 move scripts. The one in DeskDrawer was not executable so was never being run.

 

Fixed the permissions and now all works 

 

BTW: Suggest you add a message when testing for and finding an empty return (eg when pressing escape instead of selecting a folder); else you get a notification with no contents

Share this post


Link to post

That's odd. I've just re-downloaded the file from CloudApp and inspected the unzipped package, and the move_drawer.sh file is definitely fully executable by "everyone". Any idea how it might have got changed?

 

Oh well, glad you figured it out. Let's hope yours is an isolated case. (Any other forum lurkers noticed any problems??)

Cheers.

Share this post


Link to post

So, you're saying that the drawer list only shows a subset of the items that should be in there? Can you check that the files are there if you look in the DeskDrawer folder directly? (Cmd-Select an item to "Reveal in DeskDrawer folder").

 

And did you move them from your desktop using the "sweep" command, or using the "Move to DeskDrawer" file action?

Share this post


Link to post

So, you're saying that the drawer list only shows a subset of the items that should be in there? Can you check that the files are there if you look in the DeskDrawer folder directly? (Cmd-Select an item to "Reveal in DeskDrawer folder").

 

And did you move them from your desktop using the "sweep" command, or using the "Move to DeskDrawer" file action?

 

I used the sweep command. When I look directly into the DeskDrawer's folder, everything's here.

I also tried to set a new location for the DD's folder but there's the same issue

Share this post


Link to post

I used the sweep command. When I look directly into the DeskDrawer's folder, everything's here.

I also tried to set a new location for the DD's folder but there's the same issue

That's an odd one. I did wonder if it might have had something to do with the international characters, but it doesn't really look like it. There must be some kind of special attributes on some of those files that is causing them to not show up. Can you just try something if you wouldn't mind — make a bunch of really simple txt and image files (just take screenshots) with really short, simple filenames and sweep them to the DeskDrawer and let me know if they show up?

Share this post


Link to post

Actually, I've just noticed that in your list of files that are showing up, it's the first ones alphabetically of your full set. So it's probably not a problem with the script not getting the files properly. Can you just double-check that you've got Alfred set to show a full list of results with a scroll indicator? (See screenshot:)

 

screenshot20130207at120.png

 

Can you scroll down manually? (with cursor arrows.)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...