Jump to content
Sign in to follow this  
AustrianOak

Copy text from ini and paste it into input

Recommended Posts

AustrianOak

Is there a way I can use ClipGet() and ClipPut() to copy and paste text into an input instead of manually having to Send each word character by character?

Edited by nowagain

Share this post


Link to post
Share on other sites
Paulie

You basically just asked "Is there a way I can use a car to drive from place to place?"

Yes.

Share this post


Link to post
Share on other sites
AustrianOak

I'm sorry, I actually meant to go more into detail. What I don't fully understand is how does ClipGet() know what variable or string I want to retrieve? I'm reading through the helpfile and I dont see any parameters for ClipGet().

Same thing with ClipPut()

I've never used this before so sorry for being dense.

Edited by nowagain

Share this post


Link to post
Share on other sites
cartman380

Ok, read the help file for IniRead, it tells you how to pull out the values you want. FYI you don't need to use ClipPut or ClipGet to place the retrieved value into an input.

Example: Put the name of the file, the section of the ini, the key you want, and the default value if it doesn't work

$ReadValue = IniRead ( @ScriptDir & "\myfile.ini", "mySection", "myKey", "myKeyFailed" )
If ($ReadValue <> "myKeyFailed") Then
; whatever you need to do just use $ReadValue to place it into the "Input"
EndIf

Share this post


Link to post
Share on other sites
Cater

Put string in input from clipboard.

#include <GUIConstantsEx.au3>
GUICreate("Example", 200, 80)

$input = GUICtrlCreateInput("Blabla", 10, 10, 180)
$button = GUICtrlCreateButton("Put from clipboard", 40, 40)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
    Case $button
        GUICtrlSetData($input, Clipget())
    Case $GUI_EVENT_CLOSE
        Exit
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites
AustrianOak

@cartman:

you're confused badly as of what i want to do.

i am not interested in "placing" whatever text i have into an input. im interested in "pasting" and was wondering if i could do it with clipget() and clipput()

if it cant be done thats all i need to know.

Share this post


Link to post
Share on other sites
AustrianOak

@cater:

what if i have text stored in a variable

like this:

If IsArray(Search) Then
    For $i = 1 To $Search[0]
        ControlSetText($handle, "", "Edit1", "")
        ClipGet(); how would i use this
        ControlSend($handle, "", $Edit, $Search[$i] & "{Enter}"); instead of this
Edited by nowagain

Share this post


Link to post
Share on other sites
Cater

Do you want control send contents of clipboard?

if you do then

If IsArray(Search) Then
    For $i = 1 To $Search[0]
        ControlSetText($handle, "", "Edit1", "")
        $clip = ClipGet()
        ControlSend($handle, "", $Edit, $Search[$i] & " " & $clip & " " & "{Enter}")

array number + clipboard contents + enter :)

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  

×