Search found 1183 matches

by Descolada
03 Apr 2022, 12:28
Forum: Ask for Help (v1)
Topic: How to loop without some code? Topic is solved
Replies: 4
Views: 599

Re: How to loop without some code? Topic is solved

GetKeyState tells you if the key is pressed down or not, so the While loop will work until Space is released. Note that "LButton down" will keep the LButton pressed down, so you should either use just "LButton" or put "LButton up" somewhere. Send, {Esc} Sleep, 25 Send, {1} Sleep, 25 Send, {LButton d...
by Descolada
03 Apr 2022, 12:22
Forum: Ask for Help (v1)
Topic: Modify String. Topic is solved
Replies: 14
Views: 1683

Re: Modify String. Topic is solved

replacementFunction(str, functionName, search, replace, value := "ReplaceSearchItem") { out := StrReplace(str, """", """""") out := "`tlocal output`n`toutput := """ . StrReplace(out, "`n", "``n""`n`toutput .= """) . """" out := StrReplace(out, search, """ " replace " """) out := StrReplace(out, " "...
by Descolada
03 Apr 2022, 10:09
Forum: Ask for Help (v1)
Topic: Having trouble changing clipboard text
Replies: 15
Views: 1376

Re: Having trouble changing clipboard text

Maybe this works? I added SendMode Input for a more reliable Send method, also {Ctrl down}c{Ctrl up} might be more reliable. After Ctrl+C do ClipWait for 1-2 seconds (Clipboard isn't updated right away after Ctrl+C, and ClipWait needs the Clipboard to be empty), then start working on the clipboard. ...
by Descolada
03 Apr 2022, 09:29
Forum: Ask for Help (v1)
Topic: Deconflict between two regex Topic is solved
Replies: 57
Views: 4995

Re: Deconflict between two regex Topic is solved

Good point. You can precede that line with this one: clip := StrReplace(clip, ",") it will be challenging as this script has more than 10 scenarios that clip can flow to, and in those scenarios, I will not want to trim the comma away. Will it be possible to modify the first line such that I will on...
by Descolada
03 Apr 2022, 09:17
Forum: Ask for Help (v1)
Topic: excel comobject problem
Replies: 12
Views: 1726

Re: excel comobject problem

There probably is a more elegant way of doing it, but this should work: xl := ComObjCreate("Excel.Application") xl.Workbooks.Open("G:\My Drive\Untitled folder\1.xlsm") xl.Sheets("sheet1").Select B17AS21 := xl.range("B21:AS21") xl.ActiveWorkbook.Save xl.Workbooks.Open("C:\Users\iViLL\OneDrive\A\2.xls...
by Descolada
03 Apr 2022, 08:54
Forum: Ask for Help (v1)
Topic: OnMessage threading issue
Replies: 4
Views: 502

Re: OnMessage threading issue

The answer may be here regarding HSHELL_WINDOWDESTROYED, which states: A top-level, unowned window is about to be destroyed. The window still exists when the system calls this hook. So it seems that the window already being destroyed instead of being about to be destroyed prevents it from working, ...
by Descolada
03 Apr 2022, 08:25
Forum: Ask for Help (v1)
Topic: OnMessage threading issue
Replies: 4
Views: 502

Re: OnMessage threading issue

Very interesting... Do you have any idea why this might be happening though? I think the external program I am trying to monitor is doing something similar, so it would help to understand the issue more fundamentally. I managed to replicate the LButton hotkey issue as well. With this the separated s...
by Descolada
03 Apr 2022, 07:32
Forum: Ask for Help (v1)
Topic: Why doesn't this script send 2 times "b"?
Replies: 5
Views: 607

Re: Why doesn't this script send 2 times "b"?

Because your for loop is expecting coordinates and you are giving it functions (send and sleep). Either you need to modify your for loop to handle the send and sleep cases, or split it into parts. ClickCoord(x,y,sleepDown=65,sleepUp=65) { move(x, y), DllCall("mouse_event", "UInt", LBDN := 2) Sleep, ...
by Descolada
03 Apr 2022, 07:23
Forum: Ask for Help (v1)
Topic: excel comobject problem
Replies: 12
Views: 1726

Re: excel comobject problem

It depends on what you plan to do with the cell texts. This for example would loop through the range and display cell texts one by one:

Code: Select all

B17AS21 := xl.range("B21:AS21")
for cell, in B17AS21 {
  ToolTip, % "Cell text: " cell.Text
  Sleep, 500
}
by Descolada
03 Apr 2022, 07:12
Forum: Ask for Help (v1)
Topic: Run something if GUI hotkey is pressed Topic is solved
Replies: 4
Views: 650

Re: Run something if GUI hotkey is pressed Topic is solved

You mean something like this? Gui, Add, Hotkey, x0 y0 w90 h20 gHotkeyControl vHotkeyControl Gui, Show, w90 h20, My GUI previousHotkey := "" return HotkeyControl: if previousHotkey Hotkey, %previousHotkey%, Off ; disable the previous hotkey if !HotkeyControl return Hotkey, %HotkeyControl%, DoSomethin...
by Descolada
03 Apr 2022, 05:19
Forum: Ask for Help (v1)
Topic: excel comobject problem
Replies: 12
Views: 1726

Re: excel comobject problem

I think your code does not close the Excel process, so if you run it more than once then it keeps your second xls file as read-only and prevents further changes from being made. Open Task Manager with Ctrl+Alt+Del and kill all "Microsoft Excel" processes. Then try this: xl := ComObjCreate("Excel.App...
by Descolada
03 Apr 2022, 04:56
Forum: Ask for Help (v1)
Topic: Run something if GUI hotkey is pressed Topic is solved
Replies: 4
Views: 650

Re: Run something if GUI hotkey is pressed Topic is solved

If you want an associated label to activate then you need to specify a g-label like this: Gui, Add, Hotkey, x0 y0 w90 h20 gHotkeyMyVar vHotkeyMyVar Gui, Show, w90 h20, My GUI return HotkeyMyVar: Tooltip, You created a new Hotkey: %HotkeyMyVar% gHotkeyMyVar creates the "HotkeyMyVar:" routine and vHot...
by Descolada
03 Apr 2022, 04:39
Forum: Ask for Help (v1)
Topic: How to loop without some code? Topic is solved
Replies: 4
Views: 599

Re: How to loop without some code? Topic is solved

You can put the repeating part inside a Loop. For example this would send "Esc" once and sleep 25ms, then "e" twice:

Code: Select all

Send, {Esc}
Sleep, 25
Loop, 2
{
	Send, e
	Sleep, 25
}
That is if I understood correctly what your are trying to achieve. Providing a piece of your code would help a lot...
by Descolada
03 Apr 2022, 04:21
Forum: Ask for Help (v1)
Topic: OnMessage threading issue
Replies: 4
Views: 502

OnMessage threading issue

This first code will try to detect each GUI closing and display a tooltip accordingly, but it will display a tooltip only after the second window closes: #NoEnv #SingleInstance force #MaxThreads 20 SetBatchLines, -1 DetectHiddenWindows, On DllCall( "RegisterShellHookWindow", UInt, A_ScriptHwnd ) Msg...
by Descolada
29 Mar 2022, 23:26
Forum: Scripts and Functions (v1)
Topic: FindText - Capture screen image into text and then find it Topic is solved
Replies: 1091
Views: 587161

Re: FindText - Capture screen image into text and then find it Topic is solved

Can someone make a full function youtube tutorial video for this FindText class please? :thumbup: I only have different ways to incorporate different mouse clicks on this thread. https://www.autohotkey.com/boards/viewtopic.php?p=441482#p441482 I want to do a video tutorial but sorry paid work comes...
by Descolada
28 Mar 2022, 12:12
Forum: Scripts and Functions (v1)
Topic: FindText - Capture screen image into text and then find it Topic is solved
Replies: 1091
Views: 587161

Re: FindText - Capture screen image into text and then find it Topic is solved

feiyue wrote:
28 Mar 2022, 04:57
@Descolada I updated it. Now combined search is case sensitive. :dance:
Thanks, works perfectly now! :superhappy: :beer:
by Descolada
26 Mar 2022, 11:54
Forum: Scripts and Functions (v1)
Topic: FindText - Capture screen image into text and then find it Topic is solved
Replies: 1091
Views: 587161

Re: FindText - Capture screen image into text and then find it Topic is solved

What I am trying to find out is whether I could do something like this: Text.="|<S>*150$5.003cEM88T002*150$4.00S8kl7U08" ; I combined both "S" characters into one FindText().PicLib(Text, 1) ok := FindText(X,Y,0,0,0,0,0,0, FindText().PicN("SSS"),,0,1) ; And now this would first look for S1, then che...
by Descolada
19 Mar 2022, 09:00
Forum: Scripts and Functions (v1)
Topic: FindText - Capture screen image into text and then find it Topic is solved
Replies: 1091
Views: 587161

Re: FindText - Capture screen image into text and then find it Topic is solved

and Why are S1, S2, S2 separate in your search in 3 different lines? Why don't you just search for S1S2S2 as one chunck? Yes that is possible, this was merely a really simplified example Also, you said "whereas I want to also match S1S1S1, S1S1S2 etc." then that would mean either adding all those t...
by Descolada
19 Mar 2022, 04:04
Forum: Scripts and Functions (v1)
Topic: FindText - Capture screen image into text and then find it Topic is solved
Replies: 1091
Views: 587161

Re: FindText - Capture screen image into text and then find it Topic is solved

When I try to do a combination lookup using both of them as "|<S>*150$5.003cEM88T002|<S>*150$4.00S8kl7U08" then one of them will be ignored, meaning the combination lookup won't work properly. What do you mean it won't work properly,? You seem like you know what you're doing but it seems you haven'...
by Descolada
18 Mar 2022, 06:24
Forum: Scripts and Functions (v1)
Topic: FindText - Capture screen image into text and then find it Topic is solved
Replies: 1091
Views: 587161

Re: FindText - Capture screen image into text and then find it Topic is solved

Hello, Firstly, THANK YOU for this AMAZING library! I have been using it extensively and it has helped me SO much with my automation projects. I also have a question about implementing a simple OCR with FindText. I am trying for find text inside a browser, which always uses the same font and is limi...

Go to advanced search