Jump to content
Sign in to follow this  
odexed

trouble with Send() function

Recommended Posts

odexed

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
mjoshi

Try this:

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

Share this post


Link to post
Share on other sites
kylomas

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
odexed

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
odexed

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  

×