Jump to content

Recommended Posts

Posted

How can I automate copying certain portions of text from a file (New.txt) to an application's (EXAMPLE.exe) field that's looking for the text?

Basic Example: Copy the line in New.txt that contains the computer description, then open sysdm.cpl, click the Computer Name tab, and paste the line previously copied into the Computer Description field.

Posted

maybe... read the line.... then

ClipPut("computer description")

run the new program... then

Send("^v")

8)

this does accomplish the goal, but personally i'd suggest using controlsend() or controlsettext() to populate the data rather than a straight paste...
Posted

OK, how about a harder one?:P

How do I:

1. Find a certain line in a text file

2. Cut up the line into pieces

3. Then set those pieces to variables?

Posted (edited)

OK, how about a harder one?:P

How do I:

1. Find a certain line in a text file

2. Cut up the line into pieces

3. Then set those pieces to variables?

quite easily. one sec, writing code...

$input = FileOpen("c:\test.txt",0)
dim $blah
while 1
    $line = FileReadLine($input)
    If @error Then ExitLoop
    if StringInStr($line,"This Line") Then
        $blah = StringSplit($line,",")
        MsgBox(0,"Found","This line found, and split into sections seperated by commas.  the values can be accecssed as $blah[1] through $blah[0]")
    EndIf
WEnd
Edited by cameronsdad
Posted (edited)

Wow again...

Thanks for posting that code so quickly! It worked perfectly! :P

@Valuater: Unfortunately, I can't afford to buy you a pc...that's why my name is buy me a pc :lmao:

Edited by buymeapc
Posted

Wow again...

Thanks for posting that code so quickly! It worked perfectly! :P

@Valuater: Unfortunately, I can't afford to buy you a pc...that's why my name is buy me a pc :lmao:

glad to help man.

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
×
×
  • Create New...