hello i am building my own info grab tool and am having a hard time getting what i see in the help translated into something that works all i want to do is remove 0x from a color letter code under my mouse pointer and pass in on to the clipboard the only thing i dont get is getting rid of the 2 symbols could someone tell me that little piece of code
Numpad4::
;string := %Color_Under_Mouse%
;ColorResult := InStr(string,"0x",3,2)
;ColorResult := SubStr(string,1,6)
Clipboard := ColorResult ;"x"x x_1 " y" y y_1
SetTimer, WatchCursor, Off
MouseGetPos, xpos, ypos
ToolTip, Copied To ClipBoard
SetTimer, ExitApp, -2000
return
i know what is commented out is wrong i tried things but i eather got the number filled in after 0x or nothing was removed never mind my variable mind whats in the strings those numbers is what i dont get
any help would be appreciated
#Requires AutoHotkey v1.1.33
color := "0x12C45A"
color := Format("{:X}", color)
MsgBox % color
:=
always
takes an
expression
to its right. In most cases, one would not use
%
in this circumstance.
interesting i never seen format used so i wonder is the . saying after nect symbol and that being the x in the color code
I think I understand the question. The
X
is
not
telling it to capture the text that appears after the
x
in
0x12C45A
. As mikeywww suggested, the documentation explains what the
X
means. It indicates that the value is to be formatted in hex format without the
0x
prefix. You would use
#X
to indicate that the
0x
prefix is to be included.
I think I understand the question. The
X
is
not
telling it to capture the text that appears after the
x
in
0x12C45A
. As mikeywww suggested, the documentation explains what the
X
means. It indicates that the value is to be formatted in hex format without the
0x
prefix. You would use
#X
to indicate that the
0x
prefix is to be included.
thnx that was my thought, thnx for the explenation i know asking these questions is anoying for seasoned coders but for me the problem most often is not even knowing what i am looking for in the help so seeing that command was a big he wut the
and i got excited without looking it up
thnx folks
peter_ahk
wrote:
↑
i know asking these questions is anoying for seasoned coders but for me the problem most often is not even knowing what i am looking for in the help so seeing that command was a big he wut the
and i got excited without looking it up
It's not annoying. I presume that most people answering questions here do so because they like helping people learn to code with AHK. However it is best all around, especially for one's own learning, if the first step is to look at the documentation and try to find the answer there. If it's still not clear, that's what the forum is for.
It's not annoying. I presume that most people answering questions here do so because they like helping people learn to code with AHK. However it is best all around, especially for one's own learning, if the first step is to look at the documentation and try to find the answer there. If it's still not clear, that's what the forum is for.
thnx and yeah i do dive into the help first but that can be quite overwelming if you dont know what you are looking for ive been thinking to buy a book that explaines some things like all the ways variables work and its companion symbols i find that very confusing, also how to find for example the number of an item in a by a buttonclass made button. arrays i can make but reading from them i struggle with lol so many things but he i am just a guy who wants to make just 1 program that can be a toolbar for anything
from simple to complicated macros fully adjustable and saveable by preset