Jump to content

Might be a simple question


Recommended Posts

I need to make a script which copy's a selected area, for example I'm selecting the text "abcdef" then it has to copy it to the selected area by pressing the button F11 for example. Does anyone know how u might get this working?

Stefan

Link to comment
Share on other sites

Hello,

You could use this?

HotKeySet("{F11}", "_Copy")

While 1
Sleep(100)
WEnd

Func _Copy()
$FocusThing ;Something with any Focus command? (Cant test it now)
ClipPut($FocusThing)
EndFunc

-AlmarM-

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

I need a script that copy's for a example some text from notepad to a specified area / inputbox.

This might be any useful?

>>>> Window <<<<

Title: MAKEDROP © JulMar Entertainment Technology, Inc.

Class: #32770

Position: 878, 113

Size: 371, 398

Style: 0x94C800C4

ExStyle: 0x00050101

Handle: 0x000C0240

>>>> Control <<<<

Class: Edit

Instance: 1

ClassnameNN: Edit1

Advanced (Class): [CLASS:Edit; INSTANCE:1]

ID: 1000

Text:

Position: 92, 52

Size: 134, 20

ControlClick Coords: 9, 9

Style: 0x50012080

ExStyle: 0x00000204

Handle: 0x000901E8

>>>> Mouse <<<<

Position: 982, 203

Cursor ID: 0

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> Visible Text <<<<

Available Line Devices:

H323-verbinding

Number to Dial:

Timeout:

1000

Spin1

&Start

State to Drop on:

Busy

>>>> Hidden Text <<<<

This is the 'box' that has to be filled with the copied text.

Edited by Stefan22
Link to comment
Share on other sites

Do you want to select all | selectively choose | have the computer copy it all or what kinda copy are you trying for? Because with a focus is something to do with having the computer copy it all or selectively choose

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Link to comment
Share on other sites

Getting a Error,

C:\bla bla bla\AUTOIT Files\tester.au3 (8) : ==> Expected a "=" operator in assignment statement.:

$Focus

$Focus^ ERROR

you need to declare your variable by using the =

edit: got replyed to quicker than I posted I guess lol

Edited by will88
Link to comment
Share on other sites

Yes, I want to select some text, and when I'm pressing the button F11 for example is has to copy it to the ControlID I gave you in the summary. And the text is has to copy can be different all the time btw.

Link to comment
Share on other sites

I think the command you are truely looking for is: ControlSend

Look that up in the help file, try to fiddle with it and search the forum for any questions you might have.

This command sends text to a control (or 'selected area' if you wish)

This won't work im afraid, hmm or is it possible to send different kinds of text with this command? Thought this was like ControlSend("123456789") so the text is always the same in the script, I want it to be different all the time.

Link to comment
Share on other sites

We've pm'd some msg's and this came outta it as working:

(It works at least with 2 notepad window's. We did, however, had to use a portion of the original title because it seems that . and , and such can not be used as a title)

HotKeySet("{F11}", "copysel")

While 1
    Sleep(50)
WEnd

Func copysel()
    $selected = ControlCommand("sourcetitle", "", "Edit1", "GetSelected", "")
    ;MsgBox(0, "", $selected)
    ControlCommand("targettitle", "", "Edit1", "EditPaste", $selected)
EndFunc

Exit

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...