buymeapc Posted December 22, 2005 Share Posted December 22, 2005 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. Link to comment Share on other sites More sharing options...
Valuater Posted December 22, 2005 Share Posted December 22, 2005 maybe... read the line.... then ClipPut("computer description") run the new program... then Send("^v") 8) Link to comment Share on other sites More sharing options...
buymeapc Posted December 23, 2005 Author Share Posted December 23, 2005 Wow....I have been reading the help file for hours....I guess my mind is shot Thanks a bunch! Link to comment Share on other sites More sharing options...
Valuater Posted December 23, 2005 Share Posted December 23, 2005 ok... buy me a pc 8) Link to comment Share on other sites More sharing options...
seandisanti Posted December 23, 2005 Share Posted December 23, 2005 maybe... read the line.... thenClipPut("computer description")run the new program... thenSend("^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... Link to comment Share on other sites More sharing options...
buymeapc Posted December 23, 2005 Author Share Posted December 23, 2005 OK, how about a harder one? 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? Link to comment Share on other sites More sharing options...
seandisanti Posted December 23, 2005 Share Posted December 23, 2005 (edited) OK, how about a harder one? 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 December 23, 2005 by cameronsdad Link to comment Share on other sites More sharing options...
buymeapc Posted December 23, 2005 Author Share Posted December 23, 2005 (edited) Wow again...Thanks for posting that code so quickly! It worked perfectly! @Valuater: Unfortunately, I can't afford to buy you a pc...that's why my name is buy me a pc Edited December 23, 2005 by buymeapc Link to comment Share on other sites More sharing options...
seandisanti Posted December 23, 2005 Share Posted December 23, 2005 Wow again...Thanks for posting that code so quickly! It worked perfectly! @Valuater: Unfortunately, I can't afford to buy you a pc...that's why my name is buy me a pc glad to help man. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now