Jump to content
Sign in to follow this  
buymeapc

COPY and PASTE data between two applications?

Recommended Posts

buymeapc

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.

Share this post


Link to post
Share on other sites
Valuater

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

ClipPut("computer description")

run the new program... then

Send("^v")

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
buymeapc

Wow....I have been reading the help file for hours....I guess my mind is shot

:P

Thanks a bunch! :lmao:

Share this post


Link to post
Share on other sites
Valuater

ok... buy me a pc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
seandisanti

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

Share this post


Link to post
Share on other sites
buymeapc

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?

Share this post


Link to post
Share on other sites
seandisanti

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

Share this post


Link to post
Share on other sites
buymeapc

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

Share this post


Link to post
Share on other sites
seandisanti

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.

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  

×