Modify ↓
Opened on Nov 7, 2026 at 8:27:26 PM
#4113 new Feature Request
Make version of Execute() that can take multiple lines.
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
I am a ware of /AutoIt3ExecuteScript switch which allows me to run entire script with my compiled autoit exe. But problem is that this doesn't allow passing context.
Example code to illustrate how I would like to interact with context.
| Line | |
|---|---|
| 1 | Func Example($DynamicCode) |
| 2 | $ContextVariable = "Untitled - Notepad" |
| 3 | $hWnd = Execute($DynamicCode) |
| 4 | WinActivate($hWnd) |
| 5 | EndFunc ;==>Example |
| 6 | |
| 7 | $DynamicCode = "$aList = WinList()" & @CRLF & _ |
| 8 | "For $i = 1 To $aList[0][0]" & @CRLF & _ |
| 9 | " If $aList[$i][0] = $ContextVariable Then" & @CRLF & _ |
| 10 | " return $aList[$i][1]" & @CRLF & _ |
| 11 | " EndIf" & @CRLF & _ |
| 12 | "Next" |
| 13 | |
| 14 | Example($DynamicCode) |
And likewise assignment to $ContextVariable inside that $DynamicCode string would change the value of $ContextVariable that Example function sees.
Attachments (0)
Note:
See TracTickets
for help on using tickets.
