IAMK Posted July 10, 2018 Share Posted July 10, 2018 (edited) My script reads in data from a text file, line by line. E.g. 1 ^f q Then, each line gets stored in a variable for use later in a Send() command as a keyboard press. I currently have: Execute("Send(""{" & $variable & "}"")") However, that doesn't do what I want. How can I get the above code to work with the 2nd line of data? Note: I don't want to use if statements to see if there are special characters in the data to put things like ^ before the {. Is this possible? I'm thinking the best I can have is some form of RegEx which looks for special characters, then applies them before the bracket if there is one, but I have no idea how to do that. Thank you in advance. Edited July 10, 2018 by IAMK Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 10, 2018 Share Posted July 10, 2018 Hi @IAMK What's the purpose of this? What's your goal? Best Regards. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
InnI Posted July 10, 2018 Share Posted July 10, 2018 @IAMK $aLines = FileReadToArray("keys.txt") For $i = 0 To UBound($aLines) - 1 Send($aLines[$i]) Next Link to comment Share on other sites More sharing options...
IAMK Posted July 10, 2018 Author Share Posted July 10, 2018 @FrancescoDiMuro Well, I normally hardcode all my scripts, but now people want it to be easily editable in a .txt file. That way they don't need to look at code AT ALL or have to compile/build each time a change is made. @InnI I will try that tomorrow. I didn't expect it to be that easy, hence my attempted use of Execute. Link to comment Share on other sites More sharing options...
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