Jump to content
Sign in to follow this  
CDylsing

Copy two lines into the script and out to one line

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

Share this post


Link to post
Share on other sites

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

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

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

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

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 :-)

Share this post


Link to post
Share on other sites

@CDylsing
It depends from are you launching the print :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

@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

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
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

Share this post


Link to post
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


Spoiler

 

 

Share this post


Link to post
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

Share this post


Link to post
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

Spoiler

 

 

Share this post


Link to post
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 ?

Share this post


Link to post
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 ?

Share this post


Link to post
Share on other sites

@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

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

@CDylsing
Did you look at StringReplace() ?


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...