Jump to content

Copy text from ini and paste it into input


Recommended Posts

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

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

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

@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.

Link to comment
Share on other sites

@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
Link to comment
Share on other sites

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 :)

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...