Send> Causes Double Lines

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Send> Causes Double Lines

Post by armsys » Fri May 23, 2008 10:02 am

Referring to the following statements:
Let>String=ABC
ConCat>String,CRLF
ConCat>String,ABC
ConCat>String,CRLF
ConCat>String,ABC
Send>String

Why would it produce double lines between "ABC"?
In Word, it causes page breaks?
Please help. Thanks.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 23, 2008 10:12 am

Erm - because it contains two lots of CRLF - which is a carriage return and a line feed.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri May 23, 2008 10:25 am

But, how to produce single lines instead of double lines? Is CRLF supposed to produce single lines?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 23, 2008 10:29 am

CR is a carriage return character. LF is a line feed character. CRLF is a carriage return and line feed pair. A CRLF is what gets inserted when you hit the Return/Enter key on your keyboard. A CRLF is a line break. So no, CRLF won't produce single lines.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri May 23, 2008 10:59 am

The question remains the same: How to produce single-line spacing text with Send>.
Actually, I circumvented the problem by using clipboard commands. It's an identical string but Send> and Ctrl+v produce different results. Send> appears to insert (incorrectly) extra lines while Ctrl+v produce correct line spacing. In fact, when repeating Send> commands, it inserts more lines. But, why?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 23, 2008 11:05 am

CRLF characters cause line breaks (in any ascii context anyway). I'm not sure what you mean by "single-line spacing text" and I'm not sure what you want. Perhaps you should explain the outcome you are looking for - perhaps provide an example - and then we might be able to help you get there. But CRLF is like pressing Enter. They insert the same chars. CRLFs are end of line markers and line feeds.

What about using a TAB character instead? Again, I don't know what you are wanting to do.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri May 23, 2008 11:17 am

It's my fault. I should have provided a sample text in the first place.
The original text string contains the desired Result (single spacing):
ABC
ABC
ABC

Send> produces:
ABC

ABC

ABC

Ctrl+V produces:
ABC
ABC
ABC

Hope it helps explain my problem.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 23, 2008 11:20 am

Try just CR or LF on it's own:

Send>ABC%CR%ABC

Some apps want CRLFs, some just want CR or LF. E.g. Windows is different to Unix in that regard.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri May 23, 2008 11:41 am

In fact, I didn't insert any CR, LF, and/or CRLF. It's just copied directly from the screen:
Press CTRL
Send>c
Release CTRL

There's no blank lines in between just like:
ABC
ABC
ABC


But, when placing the cursor in a dialog (coomment) box, the Send> will insert multiple blank lines. On the other hand, CTRL+v inserts the identical string without any blank lines. I'm perplexed by the difference.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 23, 2008 12:02 pm

Without seeing where you copied the text from, what the text in the clipboard looks like (including all invisible chars), where you are copying it to, without dissassembling the application you're copying from or the application you're copying to, we are all in utter darkness. Without knowing how the application treats CR and LF chars we can't say why/how it deals with them the way it does.

All I CAN say is that CR is a carriage return, LF is a linefeed and both together are both together. If you want to use Send to send the text experiment with whether you need a CR between each line, or a LF between each line, or both (seems you've already ascertained both is no good) or alternatively send each line separately and use Press Enter between them:

Send>ABC
Press Enter
Send>ABC
Press Enter
Send>ABC

Or alternatively construct the text and put it on the clipboard with PutClipBoard and then paste it. Again you'll need to experiment with whether you need LFs or CRs or both.

We can spend time wondering why stuff happens the way stuff happens or we could just find what works and use it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts