CDylsing Posted September 6, 2018 Posted September 6, 2018 Hello everyoneI'm looking for a command that can copy text into the running script, so can sender to a PDF printer and should look like this.1 copy text no. 12 copies text no 2and then it will be gathered to look like this when it's going to print it to a pdf printertext1-text2but can be done without using other programs for it
FrancescoDiMuro Posted September 6, 2018 Posted September 6, 2018 Hi @CDylsing, and welcome to the AutoIt forum Are you trying to do this via command line? Which PDF printer are you using? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
CDylsing Posted September 6, 2018 Author Posted September 6, 2018 im useing Microsoft pdf printer but when i save the file i need to put tow text that i copy from are webpage and save them whit the - in between them show the whit be save like this 384-3838383 so is there a way to do this ?
CDylsing Posted September 6, 2018 Author Posted September 6, 2018 im useing Microsoft pdf printer but when i save the file i need to put tow text that i copy from are webpage and save them whit the - in between them show the whit be save like this 384-3838383 so is there a way to do this ?
FrancescoDiMuro Posted September 6, 2018 Posted September 6, 2018 Yes, it can be done How do you launch the print? And, from where do you get those information to add to the file name ( I read from a Webpage, but did you already catch them? ) ? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
CDylsing Posted September 6, 2018 Author Posted September 6, 2018 Im use the mouse and Then use the send it White crtl-c and call after Tue printer White crtl-p So im using the send command only If there is a better way to do it then please tell me :-)
FrancescoDiMuro Posted September 6, 2018 Posted September 6, 2018 @CDylsing It depends from are you launching the print Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
CDylsing Posted September 6, 2018 Author Posted September 6, 2018 I use this send({crtldown}+{p}) Nothing advance scripting I will says
FrancescoDiMuro Posted September 6, 2018 Posted September 6, 2018 @CDylsing When you Send the Print command, you are prompted to save the file, right? Just use Control* functions to set to the file name the name of it, and print it Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
CDylsing Posted September 6, 2018 Author Posted September 6, 2018 okay but how ?¨ but yes it coms op whit prompted to save the file but my skills is not good to make this show her is that i have make so far HotKeySet("{ESC}", "_Terminate") #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Local $i = 0 do $i = $i + 1 $pos=MouseGetPos() MouseClick("left",344,435,1,0) MouseMove($pos[0],$pos[1],0) MouseClick($MOUSE_CLICK_LEFT, 344, 435, 2) Send("{CTRLDOWN}c{CTRLUP}") ;it copy the select text Sleep(800) Send("{CTRLDOWN}p{CTRLUP}") ;open op for printer promp Sleep(800) Send("{Enter}") Sleep(1500) Send("{CTRLDOWN}v{CTRLUP}") ; is past the selecet text to pdf printer and here i nede to have to text line on, like this 3333-333333 sleep(800) Send("{ENTER}") MouseClick($MOUSE_CLICK_LEFT, 279, 784, 1) Sleep(900) MouseClick($MOUSE_CLICK_LEFT, 335, 802, 1) sleep(2000) Until $i = 2 MsgBox($MB_SYSTEMMODAL, "", "Totel pages copy = " & $i) Func _Terminate() Exit EndFunc ;==>_Terminate show i can i copy to text line and put them to save to pdf files ? ERS-WebpageToPrint.au3
markyrocks Posted September 6, 2018 Posted September 6, 2018 You can use some like Send("^c") ;to copy should represent control+c Make a variable like $fCopy=clipget() ;should return contents of clipboard The copy again..save as $sCopy=clipget() $result=$fCopy & "-" & $sCopy Take the result and push it to whatever file or use Clipput($result) ;to add it back to the clipboard as one string Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning"
CDylsing Posted September 6, 2018 Author Posted September 6, 2018 yes it works thanks to you all .-D her is the script i have make whit loop and count whit in how many times it runs HotKeySet("{ESC}", "_Terminate") #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Local $i = 0 do $i = $i + 1 $pos=MouseGetPos() MouseClick("left",195,194,1,0) MouseMove($pos[0],$pos[1],0) MouseClick($MOUSE_CLICK_LEFT, 202, 196, 2) Send("^c") sleep(600) $fCopy=clipget() MouseClick($MOUSE_CLICK_LEFT, 169, 353, 2) Send("^c") sleep(600) $sCopy=clipget() $result=$fCopy&"-"&$sCopy Send("{CTRLDOWN}p{CTRLUP}") Sleep(5000) Send("{Enter}") sleep(2500) Clipput($result) Send("^v") sleep(500) send("{enter}") sleep(1250) MouseClick($MOUSE_CLICK_LEFT, 151, 723, 1) Until $i = 100 ;how many times it will run MsgBox($MB_SYSTEMMODAL, "", "Totel pages copy = " & $i) ;it will show the result of runs Func _Terminate() Exit EndFunc ;==>_Terminate Tanks to you all
markyrocks Posted September 6, 2018 Posted September 6, 2018 (edited) It doesn't look like the $result is going anywhere... just getting written over everytime. If you want $result to save every result it needs to be an array Declare it I believe Dim $result[100] Do... $result= $sCopy & "-....ect i+=1 Until ubound($result)-1 Edited September 6, 2018 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning"
CDylsing Posted September 10, 2018 Author Posted September 10, 2018 okay now i test it and it works, but i have some problems getting the mouse to only make numbers so i do not copy emptying areasIs there's a way I can make the mouse to maker only number and not empty areas ?
CDylsing Posted September 10, 2018 Author Posted September 10, 2018 okay now i test it and it works, but i have some problems getting the mouse to only make numbers so i do not copy emptying areasIs there's a way I can make the mouse to maker only number and not empty areas ? okay now i test it and it works, but i have some problems getting the mouse to select only numbers so i do not copy emptying areasIs there's a way I can make the mouse to makers only number and not empty areas ?
FrancescoDiMuro Posted September 10, 2018 Posted September 10, 2018 @CDylsing You can replace the " " with "" using StringReplace() It depends from what you want to return... Only numbers? Numbers but not spaces? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
CDylsing Posted September 10, 2018 Author Posted September 10, 2018 Yes only numbers whit out sparces in if only coms when i copy the numbers line when i dubbel click on it
FrancescoDiMuro Posted September 10, 2018 Posted September 10, 2018 @CDylsing Did you look at StringReplace() ? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
CDylsing Posted September 10, 2018 Author Posted September 10, 2018 I'm doing it but can not just see where she can put it in and when I use the clipget to save speech and words, it should come first before I send it to the printer
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