EmEditor (text editor) Forum Index Macro Samples
Macro: Select whole paragraph | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| Stefan | Posted on: 5/2/2012 12:12 pm |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 264 |
Macro: Select whole paragraph I miss this feature in the EmEditor core:
|
| Stefan | Posted on: 5/3/2012 12:57 pm |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 264 |
Re: Macro: Select whole paragraph Shorter code, but takes more time due the use of regular expression:
|
| webern | Posted on: 5/3/2012 11:33 pm |
Not too shy to talk ![]() ![]() Joined: 11/23/2006 From: Moscow, Russia Posts: 38 |
Re: Macro: Select whole paragraph Just an old discussion and an example are here.
|
| Stefan | Posted on: 5/4/2012 6:16 am |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 264 |
Re: Macro: Select whole paragraph Thanks for the link!
That seems to be an old need for many. I still wonder why such basics are not in the Edit menu. Meanwhile i got an Problem: My last macro was developed with "Head-start version v11.1.7 beta" And there it works fine. Even with the line o.SetActivePoint(eePosLogical, 1, yPosEnd, True); On THIS pc i tested it now with 11.0.5 and got an problem: If i use the above line o.SetActivePoint(eePosLogical, 1, yPosEnd, True); then the "True" is not highlighted because it has to be lower case. OK. Fine. But, the script is working with that Upper case True. But then, after the selecting is done, i got the message: ("True is not defined") OK, i can change it to lower case "true" o.SetActivePoint(eePosLogical, 1, yPosEnd, true); The true is highlighted now, but the script does not work anymore. It seems it do something, but nothing is selected. Where is the bug? Update, checked again: with v11.1.7 beta only the upper case "True" works too. There is no message as with 11.0.5 after the selection. If i change to lower case "true", the word is highlighted but the script does not work here too. Only with "True". |
| webern | Posted on: 5/4/2012 1:33 pm |
Not too shy to talk ![]() ![]() Joined: 11/23/2006 From: Moscow, Russia Posts: 38 |
Re: Macro: Select whole paragraph You need to swap the yPosEnd with the yPosBeg in the last two lines, like this:
o.SetAnchorPoint(eePosLogical, 1, yPosEnd); o.SetActivePoint(eePosLogical, 1, yPosBeg, true); instead of o.SetAnchorPoint(eePosLogical, 1, yPosBeg); o.SetActivePoint(eePosLogical, 1, yPosEnd, True); |
| Stefan | Posted on: 5/7/2012 3:42 am |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 264 |
Re: Macro: Select whole paragraph Thanks webern, but that doesn't explains why it works in one version and not in the other.
Anyway, i have now understood that i doesn't need the part o.SetActivePoint(eePosLogical, 1, yPosEnd, true); and also not the part yPosEnd = o.GetActivePointY(eePosLogical); New version: Similar i use now this to just select down to the next blank line: . |
| Stefan | Posted on: 7/10/2012 6:18 am |
Home away from home ![]() ![]() Joined: 7/14/2008 From: Germany, EU Posts: 264 |
Re: Macro: Select whole paragraph //NEW, Di, 10.07.2012: error handling for BOF and EOF
I have seen an problem when the paragraph was at the beginning of the file, with no empty line above it. And the same at the end of file if there was no empty line following. So my improved macro detect this and handles accordingly: |
| netsking | Posted on: 1/28/2013 11:30 am |
Not too shy to talk ![]() ![]() Joined: 8/23/2008 From: Posts: 34 |
Re: Macro: Select whole paragraph Thanks a lot. I tried it out. It works fine for me.
|
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |




