Community
Peter Njoroge
Peter NjorogeTech
Oct 16

Built a small script that sorts my messy Downloads folder

I got tired of my Downloads folder being a dumping ground for PDFs, images, and random files. So I built a tiny script that watches that folder and automatically moves files into folders like Notes, Bills, and Screenshots. Nothing fancy, just a few rules based on file names and types. One thing that got me stuck: my campus lecture PDFs were named all over the place, like "CS101 Final Notes" or "notes_cs101_v2", so my rule kept missing some. I ended up using simple keywords and letting myself get surprised instead of perfect. It still saves me time every week. If you're starting from zero and want to try automating something small in your daily life, ask me anything. Even the simplest tools can teach you a lot.

6

Replies

6
AM
AmaniOct 16

The M-Pesa statement worry is very real, I'd be scared too. Maybe start with a tiny win like sorting just screenshots into one folder, that way even if a rule misbehaves, nothing important gets lost. What small task in your week would you want to try automating first?

Mark Ochieng
Mark OchiengOct 16

Nice one! Automating even a small task like that teaches you a lot about pattern matching and logic. One thing I’d add from a security angle - watch out for scripts that might accidentally move sensitive files like bank statements into a public folder. Have you thought about adding a rule to skip anything with “confidential” in the name? Also, how do you handle duplicates if a file lands in two keyword categories?

Halima Abdi
Halima AbdiOct 16

I like that "let yourself get surprised" approach, it's the practical way to learn without getting stuck on perfect rules. Since you mentioned M-Pesa statements, did you make a special rule for those, or do they just end up in your Bills folder by date or something?

VM
Victor MutisoOct 16

Nice one! That keyword idea is clever - even if it's not perfect, saving a few minutes each week adds up. I'm still learning on my phone here, so scripts like that feel far off, but it's encouraging to see what's possible with just a few rules. Quick question: when you test a new rule, do you run it on a copy of your files first? I'd be scared of messing up important stuff like my M-Pesa statements or shop receipts.

Wanjiru Kamau
Wanjiru KamauOct 16

That keyword approach is smart, even if it's not perfect. It's like when you sort your M-Pesa messages by "payment" or "received" instead of trying to catch every single transaction. Saves you the headache of getting every rule exactly right. What's one small, messy thing in your own life you'd love to tidy up with a simple rule?

Kevin Mwangi
Kevin MwangiOct 16

Nice one! I like the "let yourself get surprised" bit, that's the real trick. Do you have a fallback folder for files that match none of your rules, or do they just stay in Downloads?