Variable into command

Get help with using AutoHotkey and its commands and hotkeys
KrycerKris
Posts: 10
Joined: 25 Sep 2017, 13:42

Variable into command

25 Sep 2017, 15:53

I have my script read a line from a file. How can I make the thing it reads into a command? To make AHK execute it, for example the file reads "C:=(A-32)", how can I make the script do the thing it reads?
User avatar
jeeswg
Posts: 3000
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Variable into command

25 Sep 2017, 17:02

A workaround to run code dynamically:
Run / RunWait
https://autohotkey.com/docs/commands/Run.htm#ExecScript
SirRFI
Posts: 278
Joined: 25 Nov 2015, 16:52

Re: Variable into command

26 Sep 2017, 05:19

Maybe look for some kind of Eval() function?
Use [code=autohotkey] forum tag to share your code.
Click on (Accept this answer) on top-right part of the post if it has answered your question / solved your problem.
User avatar
Delta Pythagorean
Posts: 330
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Equestria

Re: Variable into command

26 Sep 2017, 08:32

jeeswg wrote:A workaround to run code dynamically:
Run / RunWait
https://autohotkey.com/docs/commands/Run.htm#ExecScript


He's right, I use this all the time:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


This is just an example.
You can manipulate this and the main script (Keep the function) and use it the way you want.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], tarantules and 46 guests