Jump to content

How to can I write Ctrl + A in my Code


Recommended Posts

  • Moderators

If you have a look at the keyword "Send" in the help file index, you'll see a list of keys there right under it "Send Key List"

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to post
Share on other sites

Hi guys

Small Question

How to can I use Ctrl + A And Ctrl + V And Ctrl + C

how to can I write it in my code I want to copy some texts by the sicrpt

Well, you got to read the help file. ALL the answers are there.

To send Ctrl + A use:

Send("^a")

To send Ctrl + V use:

Send("^v")

and so on...

^=ctrl

+=shift

! = alt

The help file has examples and it's very clear.

Link to post
Share on other sites

Hi guys :)

Small Question ;)

How to can I use Ctrl + A And Ctrl + V And Ctrl + C

how to can I write it in my code I want to copy some texts by the sicrpt

Please your advice ;)

Several people have pointed you to the help file, I wanted to point out that you might also want to look at the Control functions. Run this code:
Run("notepad")
WinWaitActive("Untitled - Notepad")
Send("This is some sample test.")
TrayTip("", "waiting to send ctrl+a", 10)
Sleep(3000)
TrayTip("", "ctrl+a has been sent", 10)
Send("^a")
Sleep(3000)
TrayTip("", "waiting to send ctrl+c", 10)
Sleep(3000)
Send("^c")
TrayTip("", "ctrl+c has been sent", 10)
Sleep(3000)
TrayTip("", "waiting to send ctrl+x", 10)
Sleep(3000)
Send("^x")
TrayTip("", "ctrl+x has been sent", 10)
Sleep(3000)

TrayTip("", "waiting to set new text via ControlSetText", 10)
Sleep(3000)
ControlSetText("Untitled - Notepad", "", "Edit1", "New text sent by ControlSetText.")
TrayTip("", "text has been set via ControlSetText", 10)
Sleep(3000)


TrayTip("", "waiting to get text from notepad via ControlGetText", 10)
Sleep(3000)
$var = ControlGetText("Untitled - Notepad", "", "Edit1")
TrayTip("", "text retrieved via ControlGetText", 10)
Sleep(3000)

MsgBox(0, "the value of $var equals", $var)
Note, when you set text via ControlSetText, you can exit Notepad without it asking you to save the info.

Late - but hope this helps...

[size="1"][font="Arial"].[u].[/u][/font][/size]

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...