hey, I've been trying to work out this problem, if someone could help me would be much appreciated
I came across this
on rawKeyDown theKeyNumber
put theKeyNumber
pass rawKeyDown
end rawKeyDown
(which gives me the key number for the designated key)
so I tried the script below hoping it would work but I guess im doing it wrong.
on mouseUp
rawKeyDown 65289 ( but just gives error (button "Button": execution error at line 2 (Handler: can't find handler) near "rawKeyDown", char 1)
end mouseUp
but what Im trying to do is when I click the button in my program it launches a exe file, then I need to simulate a key press so it will do a few tasks like a macro.
some of the keys I need to work are alt, (65513) and tab (65289) for example.
and if possible to have the code press alt & tab at same time.
im trying to work through the livecode lessons and university at the moment but any help with this would help a lot.
Thanks
Simulate Keypress
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Simulate Keypress
Hi,
Is that exe file a LiveCode standalone? If not, what is it?
You might write a VBScript and use the SendKeys method to emulate a keydown.
Kind regards,
Mark
Is that exe file a LiveCode standalone? If not, what is it?
You might write a VBScript and use the SendKeys method to emulate a keydown.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Simulate Keypress
its actually Microsoft publisher, I need it to load the program which I can get to do, then I need it to sendkeys like I did in the past on visual basic to auto complete a few tasks.
kinda hoped to be able to do it in livecode.
kinda hoped to be able to do it in livecode.
Re: Simulate Keypress
Hi,
Yes, you can do that with VBScript. LiveCode can execute your VBScript with the do command.
Kind regards,
Mark
Yes, you can do that with VBScript. LiveCode can execute your VBScript with the do command.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Simulate Keypress
thx for the reply mark, I will need to read up on it.
do you mean I need to save the vbscript to a file and execute it from inside livecode, or is there a way to insert vbscript directly into livecode.
sorry total noob here but trying my best to learn livecode
do you mean I need to save the vbscript to a file and execute it from inside livecode, or is there a way to insert vbscript directly into livecode.
sorry total noob here but trying my best to learn livecode

Re: Simulate Keypress
Hi,
Look up the "do" command in the dictionary. You can use it to execute VBScript directly. Only in special cases, if you create new objects or routines, you need to create a separate file.
Kind regards,
Mark
Look up the "do" command in the dictionary. You can use it to execute VBScript directly. Only in special cases, if you create new objects or routines, you need to create a separate file.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode