Jump to content
IAMK

Use a variable for Send()

Recommended Posts

IAMK
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

Share this post


Link to post
Share on other sites
FrancescoDiMuro

Hi @IAMK:)
What's the purpose of this?
What's your goal?


Best Regards.


Click here to see my signature:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

ALWAYS GOOD TO READ:

In case I am violating some pseudo Forum rule, or I am doing something wrong, I want let you know that I'm not doing this on purpose, and for this, I kindly ask you to send me a private message about the "bad content" I posted, in order to edit/remove it, and to not be warned wrongly.
Thanks in advance.

 

Share this post


Link to post
Share on other sites
IAMK

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

Share this post


Link to post
Share on other sites

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

×