Need help with keyword search Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Pilu
Posts: 23
Joined: 22 Jun 2018, 01:13

Need help with keyword search

10 Apr 2019, 01:55

Hi,

I have some word and I have an changeable string. I would like search the keywords in this string and if the value is matched that give back the matched value.

Thanks your help

Code: Select all

$3::



		for window in ComObjCreate("Shell.Application").Windows
		{
			fullpath := ""				
			try fullpath := window.Document.Folder.Self.Path
			If WinActive("ahk_id " . Window.HWND)
				break
		}


Haystack := fullpath
Needle := FRAPNPOE|FRAPMDE|UKAPNPO|UKAPPO|ITAPPO|ITAPNPO|DEAPMD
IfInString, Haystack, %Needle%
	
	{
    		MsgBox, %Needle%
    		return
	}


 return
Moderator Note: Added post title. ~ sinkfaze
Rohwedder
Posts: 2049
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need help with keyword search  Topic is solved

10 Apr 2019, 05:27

Hallo,
try:

Code: Select all

$3::
Haystack := "I have some word e.g. UKAPNPO and I have an changeable string."
Needle := "FRAPNPOE|FRAPMDE|UKAPNPO|UKAPPO|ITAPPO|ITAPNPO|DEAPMD"
If RegExMatch(Haystack, Needle, OutputVar)
	MsgBox, %OutputVar%
return
User avatar
Scr1pter
Posts: 1069
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Need help with keyword search

10 Apr 2019, 07:12

What happened to the topic title?
Please use code tags when posting code!
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602 - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.29.00
User avatar
sinkfaze
Posts: 609
Joined: 01 Oct 2013, 08:01

Re: Need help with keyword search

10 Apr 2019, 08:12

Scr1pter wrote:
10 Apr 2019, 07:12
What happened to the topic title?
I never saw one. I have now added one.
User avatar
Tigerlily
Posts: 283
Joined: 04 Oct 2018, 22:31

Re: Need help with keyword search

12 Apr 2019, 00:58

sinkfaze wrote:
10 Apr 2019, 08:12
Scr1pter wrote:
10 Apr 2019, 07:12
What happened to the topic title?
I never saw one. I have now added one.
:offtopic:
I think empty or blank titles should not be permitted when posting initially or editing an OP. I suspect it's annoying for people to click on and annoying for mods to have to go in an manually change.
-TL
Rohwedder
Posts: 2049
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need help with keyword search

12 Apr 2019, 01:12

Hallo,
blank titles, the compulsion to use tabs, Windows 10 and some presidents also bother me.
But I am against censorship and prohibitions!
User avatar
Scr1pter
Posts: 1069
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Need help with keyword search

12 Apr 2019, 05:53

If everybody uses blank or meaningless topic titles,
the forum can be closed.

Btw would be good to receive some feedback from the OP regarding the topic itself.
Is it solved or not?

Cheers!
Please use code tags when posting code!
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602 - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.29.00

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], hasantr, Odius, opc121177, roysubs and 130 guests