Search found 57 matches

by Fee
10 Dec 2016, 11:17
Forum: Ask For Help
Topic: Confusing 'if' statement Topic is solved
Replies: 2
Views: 600

Re: Confusing 'if' statement Topic is solved

There must be no space between function name and parenthesis. That means also when used in `if` statements.

Code: Select all

if  StrLen(mybatch) > 100  { 
by Fee
09 Dec 2016, 16:05
Forum: Ask For Help
Topic: Can one add calculations in parameters Topic is solved
Replies: 9
Views: 1828

Re: Can one add calculations in parameters Topic is solved

Code: Select all

ControlMove, % "Button" A_Index+1, % X*2, % Y, , , ahk_id %WinHwnd%
Tooltip, % a / b
MyFunction( Trim(v) )
by Fee
09 Dec 2016, 07:16
Forum: Ask For Help
Topic: Reading from a edit then searching trough a site
Replies: 2
Views: 634

Re: Reading from a edit then searching trough a site

You can use HttpRequest to get contents and HTML DOM to parse the output: http://www.w3schools.com/jsref/dom_obj_document.asp Basic example for your case: Gui,Add,Text,,Search: Gui,Add,Edit,vQuery w300, Gui,Add,Button,gSearch,Search Gui,Show return Search: t:= Gui,Submit query:="query='" StrReplace(...
by Fee
06 Dec 2016, 17:02
Forum: Ask For Help
Topic: Define the 1st number when using A_Index
Replies: 2
Views: 631

Re: Define the 1st number when using A_Index

Using your example:

Code: Select all

Loop, 10
	{
y := A_Index + 10
Send %y%
Send {Enter}
	}
Return

Alternative, y:=10 being your new "zero" and 10 in <=10 being your "loop count":

Code: Select all

y:=10
while (A_Index<=10)?y++:{
	Send %y%
	Send {Enter}
}
by Fee
06 Dec 2016, 08:37
Forum: Ask For Help
Topic: Call function with a multiple line parameter? Topic is solved
Replies: 7
Views: 1792

Re: Call function with a multiple line parameter? Topic is solved

Code: Select all

testFunc(t:=
(
"test
foo
bar
return"
))

testFunc(var){
    MsgBox % var
}
Though you still practically assign it to variable.
EDIT:
Or go with:

Code: Select all

testFunc(LTrim(
(
"test
foo
bar
return"
)))
by Fee
03 Dec 2016, 16:09
Forum: Ask For Help
Topic: Moving GUI controls
Replies: 2
Views: 733

Re: Moving GUI controls

Example, since you used global I did too: DownladAdd2GUI(Links,picturename,name){ global IfNotExist,%picturename%.png UrlDownloadToFile,%Links%%picturename%.png,%picturename%.png offset_y:=50, offset_x:=25 column:=(column)?column:1 if row<5 row++ else row:=1, column++ ypos:=(row-1) * 60 + offset_y x...
by Fee
01 Dec 2016, 13:05
Forum: Ask For Help
Topic: Changing characters written depending on what follows
Replies: 4
Views: 878

Re: Changing characters written depending on what follows

Two examples you can work on: https://autohotkey.com/docs/commands/Input.htm ~l:: Input,c,VL1I if InStr("aeioul",c) Send % "{Blind}{bs 2}r" ((c="l")?"r":c) return https://autohotkey.com/docs/Hotstrings.htm :*?z:la:: :*?z:le:: :*?z:li:: :*?z:lo:: :*?z:lu:: :*?z:ll:: Send % "{Blind}r" (((t:=SubStr(A_T...
by Fee
30 Nov 2016, 06:56
Forum: Ask For Help
Topic: Is there a simple solution for Voidtools Everything search from within AHK? Topic is solved
Replies: 12
Views: 4099

Re: Is there a simple solution for Voidtools Everything search from within AHK? Topic is solved

comspec is built-in variable that contains path to your systems cmd.exe. So following lines are pretty much equivalent: Run, C:\Windows\system32\cmd.exe ; depends on your system Run, cmd.exe Run, %comspec% Run, % comspec and MsgBox % comspec just shows path to cmd.exe searchvar:="autoexec" Run, % c...
by Fee
29 Nov 2016, 17:34
Forum: Ask For Help
Topic: Is there a simple solution for Voidtools Everything search from within AHK? Topic is solved
Replies: 12
Views: 4099

Re: Is there a simple solution for Voidtools Everything search from within AHK? Topic is solved

https://autohotkey.com/docs/Variables.htm#ComSpec
http://ss64.com/nt/clip.html

Code: Select all

InputBox,searchstring,es.exe search, What to search for:
RunWait, % comspec " /c c:\programfolder\Everything\es.exe " searchstring " | clip",,hide
MsgBox % "Results copied to clipboard"
MsgBox % clipboard
by Fee
25 Nov 2016, 07:09
Forum: Ask For Help
Topic: beginer with com objects
Replies: 2
Views: 736

Re: beginer with com objects

would like to see a list of commands that i can do with the object MSDN: InternetExplorer object https://msdn.microsoft.com/en-us/library/aa752084 HTML Dom: http://www.w3schools.com/jsref/dom_obj_document.asp JavaScript: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/Ja...
by Fee
24 Nov 2016, 07:57
Forum: Ask For Help
Topic: XML: going up to ancestor with certain attribute (while being in a for loop) Topic is solved
Replies: 9
Views: 1960

Re: XML: going up to ancestor with certain attribute (while being in a for loop) Topic is solved

; target1 := foo.selectSingleNode("following::*[@*=ids]") ; Won't work target1 := foo.selectSingleNode("following::*[@*=""" ids """]") ; Will work how to escape the colon character in xpath That's not really colon per se, it's namespace, I don't have head for it right now. MSDN: XML Namespaces and ...
by Fee
23 Nov 2016, 10:58
Forum: Ask For Help
Topic: XML: going up to ancestor with certain attribute (while being in a for loop) Topic is solved
Replies: 9
Views: 1960

Re: XML: going up to ancestor with certain attribute (while being in a for loop) Topic is solved

For Einzelkommentar in AlleKommentare { _this:=Einzelkommentar while !_this.getAttribute("id") _this:=_this.ParentNode MsgBox % "Found <" _this.nodeName "> with ID:`n" _this.getAttribute("id") } http://www.w3schools.com/xml/prop_node_parentnode.asp <parent> <element> </parent> .parentNode returns.....
by Fee
23 Nov 2016, 04:57
Forum: Ask For Help
Topic: XML: going up to ancestor with certain attribute (while being in a for loop) Topic is solved
Replies: 9
Views: 1960

Re: XML: going up to ancestor with certain attribute (while being in a for loop) Topic is solved

Can I somehow jump from the variable „Einzelkommentar“ to an ancestor node? What I need to do is find the nearest ancestor node of „Einzelkommentar“ (or simply the node „Comment“) which contains an attribute called „id“. Crude way of doing it: For Einzelkommentar in AlleKommentare { _this:=Einzelko...
by Fee
22 Nov 2016, 18:39
Forum: Ask For Help
Topic: Get user to select window after clicking on GUI button?
Replies: 5
Views: 1448

Re: Get user to select window after clicking on GUI button?

https://autohotkey.com/docs/commands/Hotkey.htm If the label or function is specified but the hotkey is disabled from a previous use of this command, the hotkey will remain disabled. To prevent this, include the word ON in Options. So in the example, under Now: label, use instead: Hotkey,^LButton,Se...
by Fee
22 Nov 2016, 17:27
Forum: Ask For Help
Topic: Trying to Find a Certain Kind of String Topic is solved
Replies: 8
Views: 1560

Re: Trying to Find a Certain Kind of String Topic is solved

Are there other clever little if statement evaluations like that, and where would they be documented? https://autohotkey.com/docs/commands/IfIs.htm#If_var_is_not_type EDIT: Also, is there a difference between "if var <> 5" and "if var = 5"? Yes. These two are opposite, contradictory. https://autoho...
by Fee
22 Nov 2016, 17:15
Forum: Ask For Help
Topic: Get user to select window after clicking on GUI button?
Replies: 5
Views: 1448

Re: Get user to select window after clicking on GUI button?

Gui,Add,Button,gNow,Select window Gui,Show return Now: Gui,Destroy Hotkey,^LButton,Select SetTimer,_ToolTip,50 return Select: WinGetTitle,selected,A Hotkey,% A_ThisHotkey,Off SetTimer,_ToolTip,Off ToolTip MsgBox,,Selection set, % "Press F1 to activate selected window:`n" selected return _ToolTip(){...
by Fee
22 Nov 2016, 13:30
Forum: Ask For Help
Topic: Loop to add dashes to phn#, and also colon to mac address Topic is solved
Replies: 3
Views: 1028

Re: Loop to add dashes to phn#, and also colon to mac address Topic is solved

For phone number: Loop example as you asked for: example:= 5558765309 MsgBox % formatPhone(example) formatPhone(var){ for k,l in StrSplit(var) r.=(k=3||k=6)?l "-":l return r } And RegEx: example:= 5558765309 MsgBox % formatPhone(example) formatPhone(var){ return RegExReplace(var,"\d{3}","$0-",,2) } ...
by Fee
22 Nov 2016, 12:24
Forum: Ask For Help
Topic: Query regarding insterting characters into a variable
Replies: 3
Views: 880

Re: Query regarding insterting characters into a variable

Here you go:

Code: Select all

t:=formatNumber(1)
t.="`n"
t.=formatNumber(1234)
MsgBox % t

formatNumber(var){
    t:=StrSplit(Format("{:.2f}", var),".")
    return RegExReplace(t[1],"(\d)(?=(\d{3})+$)","$0,") "." t[2]
}
by Fee
21 Nov 2016, 15:22
Forum: Ask For Help
Topic: How to make WheelLeft/WheelRight to be activated only once per press/release cycle, regardless of the time is pressed
Replies: 3
Views: 984

Re: How to make WheelLeft/WheelRight to be activated only once per press/release cycle, regardless of the time is presse

To be honest I don't exactly understand how your code works, yet, but I am too new to all these. WheelLeft::Send % ((A_PriorHotkey=A_ThisHotkey)&&(A_TimeSincePriorHotkey<400))?"":"{Browser_Back}" You can read (and write) above line like that: WheelLeft:: if ((A_PriorHotkey=A_ThisHotkey) AND (A_Time...

Go to advanced search