Transform Your Text In 3 Simple Steps

This program can transform your text from any given case to any other case as required, e.g., uppercase to lowercase in 3 steps.

ยท

3 min read

What It Does

After using a windows machine for more than 4 years, I've noticed the lack of some features. For example, I've always wished for the ability to convert some piece of text into a specific case, e.g. lowercase to uppercase without re-typing everything.

And so, I identified an issue, and tried to implement my own solution. This program can transform your text from any given case to any other case as required. I've made every effort to make sure it's as easy and accessible to use as possible. If you have any more ideas for anything specific you'd like me to add, I'm open to ideas. Feel free to contact me!

Usage

There's a simple three step process to transforming your text to a certain format.

  1. Select the text you want to transform.
  2. Enter the hotkey, which by default is ctrl + alt + shift + x.
  3. The program presents you with multiple options for how to transform the selected text
  4. Click on the option you want, and the program will paste it in the same place as you selected from

Supported Transformations

For now, these formats are supported

  1. Transform to uppercase (LIKE THIS PHRASE)
  2. Transform to lowercase (like this phrase)
  3. Transform to titlecase (Like This Phrase)
  4. Transform to mocking text (lIkE tHiS pHrAsE)
  5. Wrap text in quotation marks ("like this phrase")

Technically

The program is written in Python, as are a lot of my other programs.

I use pyperclip to handle all the clipboard actions. To get the user selected text, I just send a ctrl + x to remove the text from where the user has placed it, and to get the text in the clipboard too. From there, I can read the contents of the clipboard using pyperclip.paste().

The selector panel is rendered using pyautogui's pyautogui.confirm() method. It returns the text of the option which was selected by the user, and the program then copies the right updated text to the clipboard, and then sends a ctrl + v to paste it in the same spot as the user picked it from.

The keybindings are handled globally using global_hotkeys, and can be changed to your liking.

What I Learned

  • One very important problem I had to figure out was that sometimes, the keybinding I had set, and the ctrl + x that the program got mixed, and the cut command wasn't registered. This wasn't immediately obvious, and I had to really think about the program and what it does to figure out what the issue was.
  • I also found out the changing the extension of Python files to .pyw means they can run in the background, without the need of a terminal window.
  • To run this .pyw file on startup, I found I could place it in the startup folder in Windows. To access it, open the "run" program with win + r and search for shell:startup. This will open a folder where you can place the shortcut to any file or program that you want to open at startup, including this file, with an extension of .pyw.

View the project for yourself!

The program is in this GitHub Gist! Feel free to ask me if you have any questions or concerns.

Get In Touch

๐Ÿ‘‹ Hi, Iโ€™m @DaKheera47, you may know me as Shaheer Sarfaraz

๐Ÿ‘€ Iโ€™m interested in making web apps in React and Node, and you can view more of my projects here

๐Ÿ’ป I'm also passionate about automating everything to improve my day-to-day life

๐ŸŒฑ Currently, Iโ€™m working as a Full Stack Web Developer at Project Mirage, a Design And Development Consultancy

๐Ÿ“ซ I'm free to talk any time on my email address,

ย