-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By noellarkin
Local $a = 1 Local $v = Execute("$a+1") ; $v is set to 2 I've been wondering if there's something similar to Execute that would work with function names, something like:
Func _IncrementNumber($thisnumber) Return $thisnumber + 1 EndFunc Local $Number = 10 Local $IncrementedNumber = ExecuteFunction("_IncrementNumber", $Number) ; $IncrementedNumber becomes 11 I haven't found anything similar to "ExecuteFunction" in the docs.
-
By junichironakashima
Im creating a code that will work in this sequence:
1. Copy the text (question) in one atea of the screen
2. Catch the 2 strings (number)
3. Multiply the 2 strings ( $1*$2)
4. Click the next area to put the answer
5. Paste the answer
This is my code
MouseClick($MOUSE_CLICK_LEFT, 479, 802, 3, 1) ;Clicking all of the text
Send("^c")
$x = StringRegExpReplace(ClipGet(), 'What is (\d*) x (\d*) \?$', "$1*$2")
MouseClick($MOUSE_CLICK_LEFT, 480, 844, 1, 1)
ClipPut($x)
Send("^v")
However the output is this
$1*$2
How can I make it solve itself? Because I tried this code:
MouseClick($MOUSE_CLICK_LEFT, 479, 802, 3, 1) ;Clicking all of the text
Send("^c")
MouseClick($MOUSE_CLICK_LEFT, 480, 844, 1, 1) $x = Execute(StringRegExpReplace(ClipGet(), 'What is (\d*) x (\d*) \?$', "$1*$2"))
ClipPut($x)
Send("^v")
Output is just blank text
-
By rkr
Hi, I have a software which has a 'run file'-ie; when i double click on that file, the input file of the software is run by the software. I wish to double click/execute this run file using autoit. how do i achieve this. i opened the software and it shows the input file and run file in same folder, i will put my autoitscript file too in same location. how do i simulate double clicking the run file (using its file name, say - abc.run ). I entered the following lines to make software window active - it became active, dont know how to go forward
Winactivate("program title")
winwaitactivate("program title")
controlclick("program title","abc.run",1000,"primary",2) ; 1000 is ctrl id
-
By SchneiMi
Hello,
following my previous question, I have moved all potentially instable object interactions into Executes. But it Looks like "="-assignments to object Attributes cannot be done with Execute, only method calls. Using an "$obj = 1" construct, it compares (Eval) instead of sets (Execute) the value.
I have tested multiple different combinations, using Execute and Assign, but it seems not to work with object Attributes. :-(
Gives following Output:
The assign Action using apply (a3) Fails, while assigning it directly, without Assign() works fine.
The execute versions compare and do not assign, in both cases. Though, the "Execute" topic in the help file says it executes, not evaluates.
I have found a similar, old thread, which explains this behavious but does not give a solution. https://www.autoitscript.com/forum/topic/110228-pass-object-property-as-a-variable/
Is there a way to assign to a com object's Attribute? Or is there anything new to this unexpected behaviour of Execute (at least compared to the help file description and Python's exec).
Any help is appreciated, and thank you for all the help so far.
Regards, Michael
-
By hawkair
Hi
I am trying to insert line numbers in to a string
with this script
Func _MyInc () Static Local $i = 0 $i += 1 Return $i EndFunc Exit _InsertLines() Func _InsertLines() $String = "A" & @CRLF & "B" & @CRLF & "C" & @CRLF & "D" $NewString = Execute("'" & StringRegExpReplace($String,"[\r\n]*", "' & _MyInc () & '\1" ) & "'") MsgBox (0, "", $NewString) EndFunc but I get this:
1A23B45C67D8
I never really could master how Execute works here and I always get some working example and make substitutions.
But this is the closest i could get...
-
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now