Search found 543 matches

by pjj
07 Nov 2013 12:08
Forum: Scripts
Topic: Need a few examples, please
Replies: 8
Views: 20591

Re: Need a few examples, please

Here you are, re-using code from the first example (ad 2): var needle = "erase this"; var d[1000]; // variable to store document text w/o lines containing needle var j = 0; // counter for d var upto = Document.LineCount; // no. of lines in original document text var x; // turn off screen u...
by pjj
07 Nov 2013 10:42
Forum: Scripts
Topic: Need a few examples, please
Replies: 8
Views: 20591

Re: Need a few examples, please

Here you are (ad 1): var s; // variable to store line of text // turn off screen updating Document.BeginUpdate(); // turn word-wrap off if (Document.Wordwrap) { Document.Wordwrap = false; } // loop thru lines for (var i = 0; i < Document.LineCount; i++) { s = Document.Lines[i]; // do something with ...
by pjj
06 Oct 2013 17:48
Forum: Scripts
Topic: Script with regex worked in RJ TextEd 8.65 but fails in 8.70
Replies: 3
Views: 14000

Re: Script with regex worked in RJ TextEd 8.65 but fails in

dustwalker wrote:I have replaced it by your own line, however, because your line is neater.
Thanks! :) I'm glad I could help.
dustwalker wrote:Note: I replaced your line's double quotes by single quotes, because my script syntax is Pascal.
I know ;)
by pjj
06 Oct 2013 14:50
Forum: Scripts
Topic: How to terminate a script with a keyboard?
Replies: 3
Views: 14290

Re: How to terminate a script with a keyboard?

And no, "Exit Script (Shift+Esc)" doesn't work for me. Here's a somewhat contrived sample of situation when you'd need it: function hideForm() { d.hide; // d.ModalResult = mrOk; } d = new TForm(nil); d.Caption = "Prepare to kill RJ TE"; d.BorderStyle = bsDialog; d.Position = poSc...
by pjj
06 Oct 2013 12:23
Forum: Scripts
Topic: Script with regex worked in RJ TextEd 8.65 but fails in 8.70
Replies: 3
Views: 14000

Re: Script with regex worked in RJ TextEd 8.65 but fails in

Without any "activation through search" this works for me on the newest version of RJ TE: Document.ReplaceAll("[\r\n]{3,}", "\r\n\r\n", false, false, true, true); and, should you prefer to be a tad more verbose, this: var s; s = Document.Text; s = ScriptUtils.WRegexRepl...
by pjj
30 Sep 2013 17:46
Forum: Scripts
Topic: How to terminate a script with a keyboard?
Replies: 3
Views: 14290

Re: How to terminate a script with a keyboard?

Image

I just run into one of these cases, hiding the main form :roll: so no way to close the app window other then killing RJ TE :roll: So, is it possible?
by pjj
30 Sep 2013 17:37
Forum: News
Topic: Polish dictionary
Replies: 1
Views: 11867

Re: Polish dictionary

Piękne dzięki! :)
by pjj
30 Sep 2013 13:53
Forum: Scripts
Topic: [tip] Is it possible to run system command?
Replies: 2
Views: 12099

Yes, Virginia, it is possible to run system command

All you need to do is to add /c switch and enclose your argument list in parentheses, e.g. MainApp.RunApp("c:\\windows\\system32\\cmd.exe", "/c (echo Yes, you can call command line from a script!)", false, false); If your argument is a file, of course you need to use double backs...
by pjj
23 Sep 2013 16:16
Forum: Scripts
Topic: [tip] Is it possible to run system command?
Replies: 2
Views: 12099

Re: Is it possible to run system command?

pjj wrote:(If it's not possible now, please treat it as a feature request.)
Actually, it would be cool to use CMD commands in scripts, but I just figured out how to solve my script-related problem without using echo. Please move it down on your to-do list 8)
by pjj
23 Sep 2013 12:45
Forum: Scripts
Topic: [tip] Is it possible to run system command?
Replies: 2
Views: 12099

[tip] Is it possible to run system command?

I would like to use echo, but perhaps other commands might be handy, too. I tried

Code: Select all

MainApp.RunApp("echo", "test > test.txt", true, true, 0);
but didn't get even error message, hence the question. (If it's not possible now, please treat it as a feature request.)
by pjj
18 Sep 2013 12:38
Forum: Extensions
Topic: About extensions
Replies: 3
Views: 27805

Re: About extensions

Would you please explain what AddSidebarPage is supposed to do again? Where exactly should I look for the new page? ...Ah, I can see it now: I had to change sidebar tabs view to "icons"; with "captions", this new page is not visible and hence inaccessible.
by pjj
17 Jul 2013 18:16
Forum: Scripts
Topic: [tip] Run script on file save
Replies: 0
Views: 9721

[tip] Run script on file save

In the latest version (8.6x) Rickard introduced really great feature: run script on file save. It may be used for a panoply of actions, among them for building target files from source files, e.g. building one CSS files from many SASS/SCSS files (this is what I do, anyway.) I hope the snippet below ...
by pjj
14 Jul 2013 19:19
Forum: Scripts
Topic: The state of the Macro system
Replies: 5
Views: 16611

Re: The state of the Macro system

Rickard,

does this mean you're going to stick to FastScript? No chance for other/better documented/more flexible script engine? FS is a no-go IMO, not in the long run.
by pjj
04 Jun 2013 08:20
Forum: Scripts
Topic: REGEX "Problem"
Replies: 5
Views: 16998

Re: REGEX "Problem"

Doesn't the "Document.ReplaceAll()" function work? Fact is, I forgot about Document.ReplaceAll() :oops: In order to redeem myself, I tried it, but when I used Document.ReplaceAll("\d", "def", false, false, true); it simply replaced letter d, not a digit. And when I use...
by pjj
02 Jun 2013 17:48
Forum: Scripts
Topic: REGEX "Problem"
Replies: 5
Views: 16998

Re: REGEX "Problem"

I don't think you can use regex in scripts, cf. www.rj-texted.se/Forum/viewtopic.php?f=11&t=1981&p=6997 For this matter (I don't mean regex alone) I'm bugging Rickard to give another scripting engine a go. While with regex you would arrive at your destination faster and more easily, maybe yo...