Jump to content

Copy From Input Field

Recommended Posts

Hi, i'm new to AutoIt and these Forums.

I am creating a GUI and...

Here is what I am trying to do in this order:

1.) Someone enters text into an Input field.

2.) Push a copy button, and it copies the text from the input field to the clipboard.

Really that's about it :( I'm just trying to get the hang of AutoIt for now, I thought you all might be able to help me with this. I have been trying things for awhile now and can't seem to get it. I can do things like creating buttons and input fields and stuff, I just can't get the copy from the input field.



Link to comment
Share on other sites

Function Reference



Creates an Input control for the GUI

Function Reference



Writes text to the clipboard.

ClipPut ( "value" )


#include <GUIConstants.au3>

GUICreate(" My GUI input acceptfile", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES
$file = GUICtrlCreateInput ( "", 10,  5, 300, 20)
GUICtrlCreateInput ("", 10,  35, 300, 20) ; will not accept drag&drop files
$btn = GUICtrlCreateButton ("Ok", 40,  75, 60, 20)

GUISetState () 

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
       $msg = GUIGetMsg()
           Case $msg = $btn

;MsgBox (4096, "drag drop file", GUICtrlRead($file))
clipput(GUICtrlRead($file)); this part added.
Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

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

  • Recently Browsing   0 members

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