Search found 1760 matches

by Albireo
Yesterday, 18:23
Forum: Ask for Help (v2)
Topic: CheckColor / WaitColor - Color names of HEX color Topic is solved
Replies: 15
Views: 430

Re: CheckColor / WaitColor - Color names of HEX color Topic is solved

What is the difference between these color-numbers below? How should I make the comparison work? (I want to enter the color in HEX format) Ex1) This doesn't work in the program above readColor := PixelGetColor( xPos, yPos ) msgBox readColor "`n" isNumber(readColor) Result .: 0x87C5D2 1 _ _ _ _ _ _ _...
by Albireo
Yesterday, 11:36
Forum: Ask for Help (v2)
Topic: Only a number (RegExMatch?)
Replies: 9
Views: 279

Re: Only a number (RegExMatch?)

IsDigit is more sensitive to what the contents of the variable are #Requires AutoHotkey v2.0 #SingleInstance Force ; x := '123' ; Correct ; x := 'A12' ; Wrong info ; x := '12&' ; Wrong info ; x := '1,2' ; Wrong info ; x := '' ; Wrong info x := 0 ; Correct ; x := "0" ; Correct if !isInteger(x) { Msg...
by Albireo
Yesterday, 10:27
Forum: Ask for Help (v2)
Topic: Only a number (RegExMatch?)
Replies: 9
Views: 279

Re: Only a number (RegExMatch?)

Thanks for both ideas. (for me isn't hex a number) The solution is similar to this .: #Requires Autohotkey 2.0 #SingleInstance Force x := '123' ; Correct ; x := 'A12a' ; Wrong info ; x := '12&' ; Wrong info ; x := '1,2' ; Wrong info ; x := '' ; Wrong info If !RegExMatch( x, '^\d+$' ) { MsgBox x "`t(...
by Albireo
Yesterday, 08:36
Forum: Ask for Help (v2)
Topic: Only a number (RegExMatch?)
Replies: 9
Views: 279

Only a number (RegExMatch?)

I want to check that a variable contains only numbers (0-9) Or rather not be empty or contain anything other than numbers. #Requires Autohotkey 2.0 #SingleInstance Force x := '123' ; Correct ; x := 'A12' ; Wrong info ; x := '' ; Wrong info If !RegExMatch( x, "^[0-9]*" ) { MsgBox "Error" ExitApp } Ms...
by Albireo
22 Apr 2024, 17:23
Forum: Ask for Help (v2)
Topic: Error handling - ahk-v2
Replies: 1
Views: 98

Error handling - ahk-v2

Have questions regarding how error handling of instructions can/should be handled. If I use the instruction PixelGetColor . What different problems can arise? The Error information for this instruction is (" An OSError is thrown on failure. ") When the link, which leads to the Error information, is ...
by Albireo
22 Apr 2024, 06:36
Forum: Ask for Help (v2)
Topic: CheckColor / WaitColor - Color names of HEX color Topic is solved
Replies: 15
Views: 430

Re: CheckColor / WaitColor - Color names of HEX color Topic is solved

You have right! (thank you)
this works!

Code: Select all

#Requires Autohotkey 2.0
inpVar := "TestLeTTeR"
If inpVar = "testletter"
	MsgBox "Yes! " inpVar "`nis found."
else
	MsgBox "No! " inpVar "`nis nor found."
by Albireo
19 Apr 2024, 19:01
Forum: Ask for Help (v2)
Topic: CheckColor / WaitColor - Color names of HEX color Topic is solved
Replies: 15
Views: 430

Re: CheckColor / WaitColor - Color names of HEX color Topic is solved

Thank you! 0x is the key. (FFFFFF is not enough) But I think it's easier to know/check what color a hex number is. ( eg. I find it easier to know that 0xFFFFFF is white, than 16777215 ) Is there any good way to compare e.g. LightGreen with lightgreen ? This somehow works. (attempt to answer my secon...
by Albireo
19 Apr 2024, 16:24
Forum: Ask for Help (v2)
Topic: CheckColor / WaitColor - Color names of HEX color Topic is solved
Replies: 15
Views: 430

Re: CheckColor / WaitColor - Color names of HEX color Topic is solved

OK the color is saved as an integer in the object. The hidden script below give the folowing result black = 0 darkred = 8388608 lightgreen = 8898002 red = 16711680 white = 16777215 #Requires Autohotkey 2.0 #SingleInstance Force cValues := Map( '' , , 'white' , 0xFFFFFF , 'black' , 0x000000 , 'lightg...
by Albireo
18 Apr 2024, 17:52
Forum: Ask for Help (v2)
Topic: CheckColor / WaitColor - Color names of HEX color Topic is solved
Replies: 15
Views: 430

Re: CheckColor / WaitColor - Color names of HEX color Topic is solved

This code work! (with Sleep 1000 ) #Requires Autohotkey 2.0 #SingleInstance Force CoordMode 'Pixel', 'Window' Run 'notepad.exe',,, &tstPID WinWaitActive 'ahk_pid ' tstPID Sleep 1000 Color := PixelGetColor( 40, 20 ) MsgBox '(0x87C5D2) => ' Color This code doesn't work (without Sleep ) #Requires Autoh...
by Albireo
18 Apr 2024, 14:54
Forum: Ask for Help (v2)
Topic: CheckColor / WaitColor - Color names of HEX color Topic is solved
Replies: 15
Views: 430

Re: CheckColor / WaitColor - Color names of HEX color Topic is solved

I find it difficult to know when a window has been opened. I haven't found the right solution. This doesn't work. 1) Run 'notepad.exe',,, &tstPID 2) if !WinWaitActive(WinName,, actMin) 3) if PixelSearch(&Px, &Py, xPos1, yPos1, xPos2, yPos2, hexColor, cDiff ) This works! 1) Run 'notepad.exe',,, &tstP...
by Albireo
18 Apr 2024, 10:31
Forum: Ask for Help (v2)
Topic: CheckColor / WaitColor - Color names of HEX color Topic is solved
Replies: 15
Views: 430

Re: CheckColor / WaitColor - Color names of HEX color Topic is solved

I try to understand...

If I add this instructions .:

Code: Select all

For key, value in ColorValues
      res .= key`t' = `t' value '`n'
MsgBox res
The HEX values have been converted to decimal numbers (which was a surprise)
Does it always happen?

Is it easy to know if a variable contains a HEX number?
by Albireo
11 Apr 2024, 10:42
Forum: Ask for Help (v2)
Topic: Open a website and log in with username and password
Replies: 0
Views: 70

Open a website and log in with username and password

Hi! My wish is to be able to open a web page, and then fill in the user and password in the correct fields. And confirm this by AHK pressing a button. Wait until the login is completed. All this should be done by running an AHK script. Now it is not possible to test this on the desired web page with...
by Albireo
26 Mar 2024, 11:57
Forum: Tutorials (v2)
Topic: Detect window open and close
Replies: 15
Views: 5627

Re: Detect window open and close

@Albireo the purpose of this library is to replace Win... functions with non-blocking ones: while WinWaitActive and such block script execution until the window is in the desired state, WinEvent.Active lets the program do other stuff in the meanwhile and responds only when the window reaches the de...
by Albireo
26 Mar 2024, 09:10
Forum: Ask for Help (v2)
Topic: CheckColor / WaitColor - Color names of HEX color Topic is solved
Replies: 15
Views: 430

CheckColor / WaitColor - Color names of HEX color Topic is solved

Hi! I want two functions() to handle colors. Check Color() - Reads a color on one dot. and WaitColor() - Waits until a certain color occurs at the specified coordinate. At the same time, I want to be able to name certain colors (estimated 10-20 pcs) in the call of the function(). eg. #FF0000 = Red a...
by Albireo
26 Mar 2024, 07:40
Forum: Tutorials (v2)
Topic: Detect window open and close
Replies: 15
Views: 5627

Re: Detect window open and close

Thank you Descolada ! It works (in some way.) But if I add the instruction MsgBox "Next!" (after the structure above) #requires AutoHotkey v2 #include WinEvent.ahk WinEvent.Show(AIMS_Showed, "AIMS ahk_exe !!!!.exe ahk_class TShellForm", 1) Try Run aProg.file, aProg.path, "Max", &AimsPID catch as e {...
by Albireo
25 Mar 2024, 10:03
Forum: Tutorials (v2)
Topic: Detect window open and close
Replies: 15
Views: 5627

Re: Detect window open and close

Many good examples (of a rather difficult problem) One question is .: When has a program started? In order to control the program I am currently working on, the window must be visible on the screen. Now I do it in this way .: ... Try Run aProg.file, aProg.path, "Max", &AimsPID catch as e { MsgBox "E...
by Albireo
15 Mar 2024, 17:26
Forum: Ask for Help (v2)
Topic: Manage dual GUIs
Replies: 9
Views: 258

Re: Manage dual GUIs

Yes, but... Summary 1) Transferring information between Gui functions? (Without making GUIs Global) 2) Gray out a Gui that is disabled - Possible? - How? Description If I use one of your example scripts, which is slightly modified, you might understand my problem. #Requires AutoHotkey v2.0 #SingleIn...
by Albireo
14 Mar 2024, 17:03
Forum: Ask for Help (v2)
Topic: UseErrorLevel -> try / catch Topic is solved
Replies: 1
Views: 113

UseErrorLevel -> try / catch Topic is solved

Hello! In AHK v1 I used UseErrorLevel in the Run instruction. Now I thought I'd try using try / catch Something similar to this .: try Run C:\Program Files (x86)\...ABC.exe, C:\Program Files (x86)\...\bin, Max, AimsPID catch as e ; Handles the first error thrown by the block above. { MsgBox "An erro...
by Albireo
14 Mar 2024, 15:47
Forum: Ask for Help (v2)
Topic: Manage dual GUIs
Replies: 9
Views: 258

Re: Manage dual GUIs

#Requires AutoHotkey v2.0 #SingleInstance force init ExitApp init() { Static fontSize := 10, width := 330, height := 200 gui_Close := (gui) => (main.Opt('-Disabled'), gui.Hide()) main := Gui('-DPIScale', 'Main'), main.SetFont('s' fontSize) main.AddButton('w' width, 'Help').OnEvent('Click', btn_Clic...

Go to advanced search