Jump to content

Recommended Posts

Posted (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 by IAMK
Posted

@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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...