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

Updating GUI in Sift / Text matching

Get our updated version of Sift / a great text matching script

Changing GUI to be editable & great fuzzy matching script: Sift
Changing GUI to be editable & great fuzzy matching script: Sift

The key idea of the video is to demonstrate how to make a GUI editable and implement a fuzzy matching script in AutoHotkey for improved search options and the ability to save and modify information.

  • 00:00 📝 The speaker adds the Sift fuzzy match script to their autohotkey helper and explores the concept of making the GUI editable.
    • The speaker discusses adding a fuzzy match script called Sift to their autohotkey helper, which compares the number of characters that need to be changed between words for a mathematical score.
    • The speaker discusses the idea of making the GUI editable and implementing a fuzzy matching script called Sift.
  • 02:02 🔧 To make a GUI editable, select the control, delete the read-only option, and type on it; use the select command to highlight text instead of replacing it, allowing for easy identification of multiple word matches as you type.
    • To make a GUI editable, the speaker suggests selecting the appropriate control, checking for the read-only option, deleting it, and then the user can type on it.
    • Modify the text to highlight instead of replacing it, using the select command to select the word on the edit control.
    • You can search for and highlight multiple instances of a word in the editor as you type, allowing for easy identification of matches.
  • 04:52 📝 The speaker suggests using variables from controls instead of static data in the GUI, discusses issues with replacing controls and text, and provides potential solutions.
    • The speaker suggests using the variable from the control instead of the static data to display and use the information in the GUI.
    • The speaker discusses a potential issue with replacing controls when typing and suggests using a text file or allowing users to paste text instead, while also considering the problem of looping and suggesting setting the variable data to the displayed control.
    • The speaker discusses a problem with replacing text in a GUI and suggests a potential solution by saving the original data and returning it at the end.
    • If the query text is empty, the script will display the original text, otherwise it will display the generated query text.
  • 10:53 🔧 The speaker proposes using the text typed in the GUI as search data, discusses making changes to the GUI and a fuzzy matching script, and suggests a fix for restoring old data.
    • Replace the current data with the original data and set the old data outside of the current context to be able to restore it later.
    • The speaker discusses the problem of storing and using data in a GUI, and proposes a solution to use the text typed in the GUI as the search data.
    • The speaker discusses making changes to the GUI and a fuzzy matching script, encountering some unexpected issues but ultimately finding a solution.
    • The speaker discusses a problem with restoring old data and suggests a fix by checking if the old data is not equal to the new data.
  • 17:48 📝 The speaker explains how to set up an editable GUI and a fuzzy matching script called Sift, allowing for the saving and modification of information for future use.
    • The speaker discusses the process of changing GUI and saving information in order to modify it later.
    • The speaker discusses setting up an editable GUI and a fuzzy matching script called Sift, where the goal is to save changed information in the haystack variable for the query to use instead of the original data.
    • The speaker demonstrates how to test and remove data, ensuring that the whole data is not blank and retrieving the previous data.
  • 24:53 📺 The speaker shows how to change the GUI and implement the Sift fuzzy matching script, allowing for editable text and improved search options.
    • The speaker demonstrates how to change the GUI and implement a fuzzy matching script called Sift.
    • You can update the text at the bottom to perform different tests and the issue was having to consider two controls for the searches.
    • The speaker explains how they separated the query and haystack sections to prevent constant changes and make the text editable, allowing the function to still work.
    • The script allows for fuzzy matching of words within a sentence, with options to search for matches anywhere, at the beginning, or to the right of the sentence.
  • 30:45 📝 The speaker explains how to use regular expressions for precise matching, discusses extending a test script for text changes, and emphasizes the importance of fuzzy matching and customizable matching functions.
    • Exact match means that it matches exactly what you have, but it doesn’t work if there are other options.
    • The speaker explains how to use regular expressions to match characters in a specific order and how to match complete words in a specific order.
    • The speaker discusses extending a test script to allow for changing the text, borrowing and adapting functions, and the importance of fuzzy matching and the ability to modify matching functions.
  • 34:43 👍 The speaker recommends checking out their course on GUIs with AutoHotkey called “Gooeys are Easy” as it is high-quality and learning GUIs is not as complex as it seems.

 


hey everyone it’sjoe and Isaias’s from the-Automator and we were we’re working still on our script for the AutoHotkey helperit’s getting closer and closer but we wanted to add like a a fuzzy match when you type so it’s not a perfect match and we i was telling Isaias’s about this cool script on the forum called sift yeah remember who the author is i think it’s yeah it is it is on the file itself so yeah so yeah but yeah what’s great his name was fanatic guru or something like that yeah

yeah very coolyou know the only thing that messes it was kind of funny because so again my background is in data science right and levenshtein comparison is one where you youit’s another comparison that i think at some point maybe we’ll add it to this thingbut it it compares hey how many characters do i have to change in order to go from this word to that word and it gives you a mathematical score and so these are things you can do for waiting to say hey what’s my best match right what’s best

comparisonanyway in this script i want you to go ahead and share your screen here yesi was telling you because we were doing it on our script and i said why don’t you just bring it back into the original script and let’s change the text that we’re searching across to dynamically look at it the problem is when phonetic guru did this he hard coded the text that’s visible which i’m not knocking he didn’t don’t get me wrong it’s amazing script very very cool but hey wouldn’t it be

great if this was actually an edit field maybe it starts off with the text go ahead and yeah so here yeah because Isaias’s knows so much about gooeys and you guys might want to consider our intro to googie’s course he’s the one that led that entire thing right and it’s it’s so easy for him he’s like i can swap that out and you know yeah it was something it was yeah but it was something very simple the the the thing that he did is that he justcreated the edit control and he just made it to be

uh read-only so what happens is that he just set up some text in it and now if you try to type on it nothing is going to happen because it is red on ribbon this is very common on differentscenarios in which you just want to present some information to the user and you don’t you don’t want them changing the information it’s just for notifications and stuff like that but in general it is very easy to add that feature to an edit control or remove it in this case i just went ahead and looked for all the other controls

i just selected one of them and i noticed where myeditor highlighted so it highlighted the second one down here the reason why i didn’t pick the first one is because it doesn’t have the option here to be read-only so i just selected the second one and when i checked yeah sure enough there’s the read-only option right there you just delete that save and you reload your script and you’re good to go now this you can actually just go ahead and remove it and now you can type on it now one of the things that we were uh

let me verify if this works right now so if we have like this is a test i just wanted to know if i just look for testsso that’s why that’s the reason why he doesn’t he doesn’t want you to kind of likeedit the text because he’s adding it himself we what we could do is try to modify this to instead ofreplacing the text how he’s doing it because what he’s doing is just he’s replacing the text to to just put the text that matches whatever he was looking for but we could actually try to highlight

the text instead of that i don’t know if you remember that we were dealing with somesend message commandson the edit control the notepad and we were trying to go to a line if we were trying to jump to a line at that momentand that was for our other script right right and we were sending messages to theedit control and one of the messages that you can do is use theselect command to select the word on it so that’s a message that you can send the only thing is that you have to know where where the word starts and where it ends

probably with this same function we could actually do the search and figure out the position in the in the in the editor even if there’s multiple instances of it because no i don’t think i think you can only highlight the first one but i don’t think you can highlight many of them just one but but then that’s i mean that’s the point of this one is it you know as you type it it’s showing you what matches and it gets yes what we could do in this case just to kind of like continue with the

example that we were trying to do as i know that he’s actually just replacing the information from a variable i know what variable that is because you put it here in data right right so what i could do is that whenever he goes ahead anduh he just set it to the edit control but whenever you type which is the query in here he’s doing a submit no hide and he’s just grabbing the information from the control so what i would say is like the controls variable is we display here i really think at some point he’s going

to use it here it is and this is where he sets the control right for that text now from the gui display he’s grabbing the text from data which is something that he has statically done but i could just instead of using data i could just use the variable of the of theright so so i’m just going to use whatever is in the control at that moment and i will just use that right so let me go ahead and verify what we have now i think that would be an issue because as soon as i start typing what is going to happen is

that as it is going to replace the control then it’s going to come empty in the end so i know that this is not going to work but i could i if i think about it if i think about how i could do it in a way that i just use whatever you just typed instead of replacing the control maybe i should do something else we will see how we’re going to do that go ahead i mean i would do just because i’m lazy right i would just setdata to be equivalent to a file read and point to a text file and then just tell people you just edit the text file

put the text file you want the text in the text file you want and you’re good to go now here’s here’s what i was thinking yours is much sexier don’t get me wrong no but what i was just thinking is like we could just allow you to paste text right here whatever i want to try so this is a test and now when i start doing the queries it would use whatever initial text was there the first time to do the the matching of do the whole matching right right but doesn’t that fall into when you have the loop thing where it’s

coming back to it over and over that’s going to end up breaking it because you’re you’re i don’t see it this is the problem so whenever i type it is just kind of like grabbing the original text so probably what i could do what i could do is set data to whatever the control is at the moment so the variable data i got you i could just set it to whatever we displayed at that moment that would just do everything and that’s it right right so in that case what we’re gonna do just restart this time i’m just gonna

start with this is a test and this is not much if i put the word test here on top i should get the firstyeah right so now when i remove it it should go back to work right to the old to the original thing but i just replaced data now what i could do is just save data to old data and then just at the end of displaying it just return data to the old data maybe that would fix it so that way i already have the original nn hold on let’s see this is when it does it displays the now the reason why this is not working is because you have

one place where the text is and he’s just how do i say like replacing the whole text hold on what happens when you remove the whole thing like if it is on display you just put it there and what happens when it is empty when query text is empty so if query text is less than the engram size we’ll just do that if it is more it would do some display how does he bring back the original text let me let me double check on that before we continue this this is the original text he uses the word how and when i remove it he gets

the original text you see that so that’s the question how how is he so i know that query is doing that so let me see this is the one that generates the query text so this is the one that starts query text now these options this is over there so let’s just this is when just doing this makes a little bit more sense so we just run and not break yet test now let me break and let’s just remove this right now let me see how the script actually follows its path it didn’t do that it’s gonna do the display shift

now query text should be empty so if it is empty and it is a regular expression it will just bring back whatever data was so that’s what is going on i get it so now this display will return the the original data was displayed now in our case we’re replacing data with whatever is written there but what i want to do is just have the old data right so i i want to have the old data being shown here [Music] right so i would just call that the original data let’s see hold on because that is not making much sense to me then

you don’t want to you want to i think set that old data to data somewhere else outside of this right where it first gets written set that and then be restoring it to old data so you mean like when it is first written here no because the problem here is that i show the gui right and that stops right there so i don’t do anything else right there yeah but where is where is data created in the first place with the text hereon this line 76 so he’s creating the oh that’s where it’s being displayed

right but that’s not i’m to me you’re not storing it how to highlight five is where it’s being created this is where it’s been created right so now the problem is what i want to do and this is just kind of like my personal preference is that if you type something on the on the gui like here right that’s going to be used as the as the search data but the problem is that for this to happen the gui should be created already so yes the gui is going to have some basic data which is there right and after is created and it is

just done whenever i do the query and this is the thing i could just do that if query text is empty yeah that’s what i’m gonna do so if not query text so it’s not very text thendata equals old data that’s it that that would just reset it so or if it is empty yeah that should be the same so here now i don’t need to do this [Music] when i have when i do my submit i just save whatever you stored in all data but that should be done only once so let’s go ahead and do if not all data

right then you’re gonna go ahead and set it up after i have it then that’s itand what about if i change it later so if i change the data later we will see but right now this should at least do part of what i’m thinking so let’s say i change it to this is will not match if i use test and if i remove it this is the part that kind of like threw me off yeah and to be fair you know you hadn’t looked at this script at all no i have never no no so so that’s the point this is how you start adapting things

and basically what what is going on right now is that i am so hold on and what does old data contain and why did all data have that why did all data so it did it did what i was expecting my problem is that it didn’t save the data that i thought was going to save so let me go ahead and run the script again and again what makes it at least a little bit more complex is just what i’m trying to do what i’m trying to do is just not need it there’s other ways that i could do it like easier i just wanted to just

make a line and i just say this now at least with how he’d laid out and design the thing instead of how you write i’ve done it so i yeah i get oh yeah so not data what i wanted to save there is the gui display information that’s what i want to to have this is whatever i haveso this would be my original data so whatever is on the display this case i’m going to do my query i’m going to do everything now if there’s nothing there i would just restore whatever i have so yeah now now i now should work so this is

a test this should not match now if i use the test stop doing that so test and if i remove it exactly so i just have the last line that i had there so now but the problem now is that if i change the text right here so let’s say this is another test this is another watch so this text now whenever i do the test it’s going to try it but now when i restore this it’s going to restore the first test i have sothe the the way to figure this one out is that all data or old data not equals to whatever we have in there

so that’s it probably that fixes it so if i if i change the text something new it should actually get it test branch test i’m matching why is that not working probably perfectly fine yeah because they’re not the same so not good display probably data yeah and this is why i generally speaking stay away from tweets well not exactly this one is not really well this one is not about the grid itself butbecause it’s it’s you have multiple places where people come in to it right and it’s rereading that

that’s why i kind of called it a loop of like it’s reading it but then it goes back you know when you yeah yeah but the what i’m trying to do right now is just this information that i’m saving here so let me try it so if i use the test the old data is the original this is the original thing that i had at the beginning now what i want to do is kind of like change then so let’s just do this say for example if i change this to something else changing now when i do this i want it to change you know what

the way to do this is just setting up ai think for this a g label for this edit control that if you change the text in it it just saves it let me let me just do it first so the query does one thing and theoriginal text does another thing so no so let’s call this one the haystack so what i’m trying to do is if you change the haystack so the haystack starts with a with a specific information the the the variable that we have up here now if you change the haystack if you change it i want to save that

information in a way that the query then uses that instead ofwhatever it had at the beginning so the original right right exactly so what we’re doing is the script itself was using the word data right but i want to always use some very specific things so here’s the thing if i could put the old data here so what so this is the query text right now or theta is not equals to whatever you have right so what i’m trying to do is

i think this should when you type up here when i type up here i do not want to be changing the original data all the time so oh the promise that down here whenever this thing actually triggers this down here oh man that’s so annoying yeah so this green control whenever you set text on it it actually triggers this thing down here so i could just probably ignore it sojust one second yeah if i do this it should this should work right so it’s a test if i remove it should come back to where it was all right there you are

so let’s go for a test remove it why is old dataoh because we should need no height that’s why whenever you work with louise you have to submit this or get the information directly with the board so nowif we show you test and remove it the whole data should not be blank right okay a little check on something

like this what do you have so they data has this whole thing [Music] did i right so that is whatever is in there and what happens is when there is no query [Music] right this is just an update and this whole thing i do want to do it as i was doing it before which is okay okay so let’s try that so okay tell me the idea in a second

is all data yeah the whole thing exactly is working fine so this retrieved whatever i had before so this is the thing now my other my other thing is say that i changed this to something else so let’s say now it is this oh [Music] right now this should be a t exactly that’s good that’s great so now this is a test this match now i could test remove it that should bring me the whole data which is and now that’s my own match now let’s change this to test this if i say match and remove yeah there you

go so let me let me explain what happened so basically what i was trying to do was just exactly this so now you can update the text down here to whatever you like so that you can perform the texts that the the the tests that you want so i could just copy any any text like this just copy paste it and now my matching should work for whatever i just pasted and if i change the text to something else it should also work and when i remove it it should go back to that what i just pasted so whenever i am updating this guy here at the bottom

[Music] one of the issues that i was having is you have to think about this two controls one is the netid control where i’m performing the searches and the other one down here is the one that has the the main text and i if i put all my actions on the query here on the on the other control on the top it would always do an update even though i don’t want it to do an update sometimes i don’t want it to update the text and this section here i was just trying to save the information if the information changed only

what happens is that when you’re performing a query it changes every time you type so that what that’s why it was not working so whenever i’m typing it was making some changes and it was just not working out so that’s the reason why i decided to kind of like separate it on the query i just do one part and on the haystack at the bottom if you change something in there then i go ahead and save it and i know it’s not a quote unquote loop but that was my point no yeah exactly you know it keeps feeding

itself right exactly yes right so in this casethis is kind of likewe didn’t expect that i was going to go ahead and change the whole thing to perform this probably he didn’t want to do all this and that’s the reason why he made it just not editable and don’t deal with it but in this case we just change it in a way that now you can put whatever text you want and his function is still going to work out go ahead and go back up here and let’s just really quickly demonstrate a couple examples so launch the script please

because we didn’t really explain you know so that you know when you type above if it’s in at all you know if the the words you put in the query that the left match or right match or an exact which of course is going to be very rare right let me let me just copy his original text from here because with this you could definitely see very easily what we mean so when it we’re looking at in so the word that i use should be anywhere inside the sentence so if i put the word do then it would show up here and do in dos

you know it is inside it doesn’t matter where but if i search for it i should be able to find the word do somewhere in the text right now on each line right yes but this is the thing so in this case i do not see it there right so probably he the the algorithm that he’s using might have some some mishaps yeah i see that it is not here either see that so it might have some issues there now if we use it left what that does is that it would look for the word do but only if it is at the beginning of the of whatever i’m trying to match

this case it is not there there’s no line that starts for that but i could use the word how probably is it because come on maybe the i know what it is i’m sorry l tram here would work better [Music] so it is actually capturing the the the tabs that were embedded on the text and that’s the reason why it was not finding the word how so i just set up the option left and it would anyrow or yeah it has to begin with whatever you’re searching so if i use the word do there are no sentences that start with two so that’s

why they don’t show up but i could use the word can for example because i have some of them and right would be the same but to the right exactly exact match would be something that matches exactly what you have so let me go ahead and verify something i’m not sure why exact here is just kind of like deleting everything but yeah there we go exact would be like where huh well you don’t have an entire thing right it’s got to be a perfect match no but i noticed that whenever you have other options yeah it’s there but here’s just kind of

like because right because nothing oh yeah so this is not gonna work that’s what i thought that it should do but it was not going to work because there is no text in it so right yeah so probably the whole thing like if i copy paste the whole thing with that with the new lines and stuff and maybe that could work but i’m not really sure that’s right again there’s a few things that probably we don’t know if they’re working for characters is pretty cool right because it’s okay the regular

expression you know how to use that the order character so that is the i’m going to put word characters right just letter of each word right for example and it is just showing me any sentence in which you can find exactly those characters in that same order right so it has to first match the w probably here the r so it find the r over here if i put the r in front of the w it might not match that way right because it has to be in the same order now on ordered that means that it would match the characters that i type

but then it doesn’t matter where the the the character is so if i put the y before the w is still gonna match y because it doesn’t matter if the y is in front of the w or not ordered words basically you will have to find complete words i would assume so let me see the line exactly so it’s the same but it is matching the complete words in the order that you type them and on other words so this this guy is very good thisfunction is very interesting but now what we just did is that we just extended this test

script to allow you to change the text to anything else you want and then when when you use that other text just go ahead and paste it and now you can use the same for that umfor that text that you just have now so obviously this is just kind of a demonstration on the functionality of each of those codes if you want to have this in your tool you’re going to have to go through like we’re doing and borrow from it and grab the function i think it is a great way to say which one of these do i want and then

otherwise you’re copying each one over adapting it you know in this way we can say like well it’s imperative it’s so easy let’s just test it which one’s looking better this is exactly what we were trying to do witha table of contents that we had and see why is it matching in a specific way but yeah we are gonna seeit is good to have this kind of functions right so for you to go ahead and play with it and modify and do whatever you want right honestly you know fuzzy matching is not used nearly enough in a lot of

things and the ability to change how you’re matching great functions yes yes it’s true awesome well thanks mk so we’re going to be checking later hey thank you for watching that video andif you’re not aware of it we actually have a course on gui’s with AutoHotkey it’s calledgooeys are easy and they truly are i i was actually you know hesitant to make it so i i had my employees work through it and he’s a great instructor the quality of this course is is by far our best but learning gui’s

isn’t nearly as complex as you might think so please check it out thank you

Comments are closed.