Jump to content

Copy two lines into the script and out to one line


CDylsing
 Share

Recommended Posts

Hello everyone

I'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. 1

2 copies text no 2

and then it will be gathered to look like this when it's going to print it to a pdf printer

text1-text2

but can be done without using other programs for it
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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 areas

Is 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 areas

Is there's a way I can make the mouse to makers only number and not empty areas ?

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