Sign in to follow this  
Followers 0
odexed

trouble with Send() function

7 posts in this topic

#1 ·  Posted (edited)

help me please. i need to make a simple script which starts notepad and open a new file.

I trying it:

Run("notepad.exe")
Send("^o")
Send("{ENTER}")

but it just prints letter "o" in notepad.

is it problem in my system? how can i do this?

P.S. autoit v.3.3.8.0

Edited by odexed

Share this post


Link to post
Share on other sites



Try this:

Run("notepad.exe")
Send("{CTRLDOWN}")
Send("o")
Send("{CTRLUP}")
Send("{ENTER}")

Share this post


Link to post
Share on other sites

odexed,

After starting NotePad (or whatever) you want to make sure that it has focus.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Try this:

Run("notepad.exe")
Send("{CTRLDOWN}")
Send("o")
Send("{CTRLUP}")
Send("{ENTER}")

it also doesn't work.

window is active and focus sets after run

it seems there is some problem with my windows 7

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Posted Image

When i press Ctrl+O on the keyboard manually it's ok

Edited by odexed

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
Sign in to follow this  
Followers 0