Automate File Organization With Free OS-Level Rules

Everybody knows that your desktop consists of screenshots taken three months ago, homework assignments of mathematics classes, and funny meme of cat with cheese. And it takes a lot of time to find something. Your desktop is full of information, and it influences your productivity negatively. You need a file cleaning program.

Fortunately, you do not need any software to clean your files. There is enough potential in your operating system. Native rules will be used to organize your files and automate the process. You will train your computer to sort files automatically.

The Magic of Smart Folders

Let's start with Mac OS X. In the Finder application Apple hid a feature called "Smart Folders". It is not really a folder but rather saved search which is always updated in real time. Consider it dynamic filter.

You can create Smart Folder of all PDF files you have. You can even create Smart Folder for all the images files which are larger than 5 MB. Operating System monitors your hard drive and dynamically groups your files according to your needs without actually moving files around. It keeps the storage structure intact.

To create a Smart Folder you need to launch Finder app and go to "File" > "New Smart Folder". You will see a button "+" in the top-right corner of the window. This button allows adding more search criteria.

There are several filters such as "Kind", "Date" or "Name" which can be applied to your files. You can choose "Kind: Image" and "Date: This Week" and you will get dynamic view of all the files you've taken during the current week. It is extremely useful for students because they can monitor all their recent files.

Windows File Explorer Magic

Windows users have their own solution. It is called "Saved Searches" and implemented in the File Explorer application. Though the interface is a bit outdated, the functionality is the same.

In order to implement it, you should start with launching File Explorer. Go to your primary user directory. Type search criteria in the search box which is located in the top right corner of the screen.

You can use wildcard symbols for searching specific file types such as "*.docx" for all Microsoft Word documents.

When the search query will be executed, you can right click on the search box and select "Save Search". This action pins virtual folder to the Quick Access bar. It is continuously updated while new files appear.

The technique can be used for monitoring project files. If your naming includes dates, you can easily filter files by date modified parameter.

The Heavy Lifting: PowerShell Scripts

Smart Folders do not move files. But how would you like your files to be moved around according to some predefined rules? This requires scripts execution and Windows has its native scripts executor. It is called "PowerShell".

Don't panic. It might seem complicated but all you need to do is provide a series of commands which should be executed by the PowerShell. Let's write a script for moving JPG images to a particular Pictures folder.

All you need is to launch Notepad application and paste the following command line there.

Get-ChildItem -Path "$env:USERPROFILE\Downloads\*.jpg" | Move-Item -Destination "$env:USERPROFILE\Pictures\Sorted"

This line of code tells your computer to look in your Downloads folder and take all files with ".jpg" extension and move them to a target folder.

Save the file as "cleanup.ps1". You have just created a program which does just one thing – moves pictures from Downloads folder.

Automating the Process

The script execution is a manual process and nobody likes to repeat actions. Fortunately, Windows OS has the solution for this problem too. It is called "Task Scheduler" and available from the Start Menu.

Launch Task Scheduler and create "Basic Task". Give the task a name like "Move my Images". Set up the trigger to execute every day or every time you log in to the computer.

In the Action tab set the "Start a Program". Select your "cleanup.ps1" file there. You may need to specify "powershell.exe" in the "Program/script" field and path to the cleanup script as an argument to the program.

Now every time you log into your computer your script will be executed automatically. It will move your images from Downloads folder to the Pictures folder automatically.

Mac Users: Automator is King

Mac users have their own powerful tool. It is called Automator and it is completely graphical solution which does not require coding experience. It is very convenient for high-schoolers who are afraid of console commands.

Launch Automator app and select "Folder Action". This means that the workflow will be attached to particular folder.

Let's use our Downloads folder again. Search for the "Move Finder Items" service and put it to the right panel of the window. Specify the destination folder where your images should be moved like a folder called "Images".

Now, when you save your workflow, drop any photo file to your

Post a Comment

0 Comments