• Become a Power user Intro to AutoHotkey Intermediate AutoHotkey Intermediate Objects GUIs are Easy w/AutoHotkey Painlessly switch from V1 to V2

AutoBolder: Easily bold text you select or double click

AutoBolder is a quick, easy to use tool to change the format of text you select or double click.  It can easily be adapted to make other changes like italic, underline, or wrap with HTML, etc.

Auto bolder- Quickly change the format of what you click / select

Auto bolder- Quickly change the format of what you click / select

The key idea of the video is to demonstrate a simple and adaptable code that allows users to quickly change the format of selected text without the need for a hard key.

  • 00:00 💡 The speaker discusses a YouTube channel called “Theories of Everything with Kurt” and how they were able to create a tool to quickly bold text in Google Docs, despite encountering some complications.
  • 01:21 💡 The speaker discusses a YouTube channel that offers a simple code to automatically change the format of selected text, making it easy to italicize or underline.
  • 02:14 🕒 Timing clicks is tricky, so the speaker set up a timer to differentiate between double clicks and selecting text, using hotkeys variables to code it.
  • 03:48 💡 The script allows you to quickly toggle bold formatting by using a hotkey, and it works for all programs, including Google Docs.
  • 05:08 📝 Pressing f9 enables the auto bold feature, allowing quick double-clicking to make words bold, and it can be undone, making it a convenient tool for typing and formatting.
    • Pressing f9 enables the auto bold feature, allowing the user to quickly double click on words to make them bold, but it can also be undone, making it a convenient tool for typing and formatting.
    • Instead of using the function “make bold,” other functions can be called with different names for formatting purposes.
  • 06:40 💡 The speaker explains how to easily generalize a function by passing a parameter and demonstrates it by modifying the format control function.
  • 08:36 💡 Quickly change the format of what you click/select by adapting it to HTML, grabbing the clipboard, modifying the code once, and using functions.
  • 09:56 💡 This video demonstrates a useful and adaptable example of how to easily change the format of what you click or select without a hard key in less than 100 lines of code.

hey guys it’sjoe lyons from the-Automator with isaias andsomeone wrote out to me kurt jaymungal he he actually has a youtube channelit’s really interesting we’ll share the link here in a secondit’s called theories of everything with kurt i’ve watched some of the videos they’re really intensei’ll tell you if you want to feel stupid watch some of these videos they’re they’re really like leveling you up yeah well actually once you go ahead and share you have it pulled up yes i do i
actually let me go ahead and open it we’ll include the link in the description to the channel and he had this idea for something apparently he uses google docsand he wants to quickly bold things and he thought hey because he programs all the hockeys okay i’lli’ll write it on hockey this will be simpleit turns out it was actually more complicated than he thought and he asked if i could help and i said let me take a quick look i’m like it was more complicated than i thought thankfully i have Isaias is
because like yeah and actually it was actually more complicated than i thought too because okay i said like you know what i could i could write this very quick and i did write it in a few minutes but then there were some little weird things going on and i was like hold onbut in the end yeah we were able to to to come up with it and it is workingin a way that might beuseful for a lot of people again this is a channel fromkurt j mungle right i’m sorry if i’m pronouncing this name his name wrong but
it is a very good channel i was actually taking a look at it myself as well and i was like okay those are very good videosand his idea of bowling automatically he’s very good i said like yeah that’s that’s a very cool thing right and of course anyone you could adapt this to you want to italicize or underline or whatever super simple so now the code is very simple again this was just a few lines of code like 60 lines of codes again it was very quick to it was very quick for us to write it down that means i’m not sure people are
looking at it of course we’ll make it available but thanks yes of course you can go ahead and take a look at the code it it’s gonna be available therebut the funny thing isthiscode it is very short it is very simple to write to be written right but there are some very tricky stuff with when you’re counting the clicks and one of the ways that i actually kind of like went around it it was to setting up a timer that checks how much time you took to click right because we wanted tograb a double
click and we also wanted to grab a draga dragging you know selecting text so a double click has a time set to it like most of the people double click in less than 500 milliseconds but[Music] selecting right text takes a little bit longer but i also wanted to make sure that clicking once wouldn’t trigger the double click later on because if you click once and count it right and then you click the second time it’s going to say oh you clicked before but that’s not how it works if you click once and then
passes a little time later then you don’t want to count that one because that doesn’t count for the double click so it was a little bit more tricky than it looked like and the way i was not used to using these Hotkeys variables because when i started coding a few years ago like 10 years ago those variables were not there so now when i’m kind of like looking at them like okay yeah i know that i could use them how can i leverage them and it was very fun to codeit took me a little a while to kind of
like get it without bugs but yeah here it is we go ahead andrun the script so the script itself yeah no no i just said line 14 yeah it doesn’t it doesn’t it’s not on by default rightline 14so i was going to say that the script is running in the background so the the the thing is not going to make the things bold Automatically you have to use aHotkey which we arbitrarily set to f9 which we could change to whatever you want or we will add it later on for you away to change it via gui or something but it doesn’t matter
in any caseit is kind of like a toggle if you press f9 it’s going to turn it on and if you press it again it’s going to turn it off but after you turn it on for example in this it works everywhere right now he wanted it specifically for google docs but we justcreated it for everywhereand that’s the line here when you turn it on it ties it to the active program right yes it does right right now that means that the active program should accept control b as the way of building because if it
does something else for control b then that’s what it’s going to do right but in any case if you need it for just one program you could use it here on line 12 and change it to whatever program you want if you wanted it for google docs we wanted it for everywhere it doesn’t matter now in this case i just go ahead and press f9 and you will see that auto bolt is on as it is being shown and if i double click on a word it goes ahead and bolts that right now if i want todo that it also works if you go ahead
and do the same it actually unbolts that right so the script the concept is very cool it seems to me thathe wants to type a lot of things and then after he’s done he just press f9 and then he just goes ahead and double clicks words like this whatever he finds out a Hotkey just goes ahead and makes it bold right and basically it’s a very very interesting concept i like it i actually use it myself yeah it’s very easy for me to go ahead and do this kind of things right right back to the point whatever you wanted to do now i noticed
actually in the script because this is we were you know we were solving kurt’s problem like exactly what he right yeah but in hindsight maybe you don’t want to bolt so in the name of the the script i saw your function one of the things was like make bold i think was the name of the function or something bold oh yeah so i had out of bold here right sohere you could take it instead of make bold which is the whole function right we could use other functions we could call other functions if you wantfor each
uh key that you want yeah i’m just saying we wouldn’t necessarily call it bold right because no no of course yeah yeah the name here might be whatever you want right apply in our case yeah like formatting for example and it might take four was it i think somewhere right around there 54 is where it goes ahead and sends the controls okay yeah so so that’s where you want that yeah so if there’s any AutoHotkey that you want to send that would be ityou could grab this whole function and make it a little bit more
generalized right sofor example this is the easy part right it was the other stuff that was really complicated this stuff is is that right so just imagine that i would send like format set format and just well no instead of math would say it because there’s a variable here return and this would be my set for my function and it would have one parameter what type of format you’re going to pass now l button and l button up is going to send bold right but control for example l button sending the thing would send the
format to italics right so basically again if you want you can generalize the function and just pass it with a parameter and that parameter then is used up here to if it is bold if type equals bold right type equals volt don’t be this else like right else if type is something else like italics or b control i i think it is or something and just by just like that i just generalized it in a few minutes i was not even thinking about doing that right now but but just to show you how easy it is to generalize a function
that you already have right and we can explain on this even more not that i would do it this way but let’s say you were adapting this to html you could actually you know have the clipboard have it grab it and then yeah and then yeah put the the tags that you remembered right yeah so you just grab the clipboard and put the text that you need right that on the clipboard but again you see how easy it is tomodify it make it a little bit moregeneralized but as you can seewhen you’re actually using this very
yeah i’m sorry i just said the usage that’s the cool part is it’s so quick and easy to actually go back now instead of doing all this funky stuff right you just select no you just you just change one line you just add an if statement and now you have whatever you’re supposed to have andand again now your code whatever type of changes that you need to do to the code you do it once and it affects all your other things that’s the beauty of functions right this is one of the things that you that
you were talking about like when you learned this it was like oh my god right the other day someone was using ghost subs and i i really wanted to jump in and be like dude if you were using functions like it would be so much easier butyes exactly but in any case let’s keep the the code how it was before but in general this is a very goodexample of what you can do easily without a hard key in less than 100 lines of code right it is less than 100 lines of code and it is pretty useful for example and very adaptable you can go ahead and
change it to some otherinteresting things that you want to do so those are the things that we wanted to present this time right awesome thanks again kurt for the the idea and concept yeah that was really cool cheers

Comments are closed.