Forum Replies Created
- AuthorPosts
- April 8, 2013 at 10:35 am in reply to: External Tools: new argument to ask / prompt for parameter #10916StefanParticipant
Hi Yutaka, thank you for the feedback.This works for Snippets… but I want to use this “parameter request box” for tools too.
It could be used for many purposes. Do you think you will implement this?
Thanks!
StefanStefanParticipant
Thank you for the feedback, Yutaka!Will this be added to the next release?
Thanks you.StefanParticipant
Hi Yutaka,I want to suggest to
* add an option “[X]Skip empty lines”
* add an option “[X]Restart numbering after empty lines”what do you think about this improvement?
Do you consider to add this feature into the next release?Thanks for any feedback.
StefanParticipant
Hi Yutaka, you are very quiet ;-)Do you consider to implement “Restore last Selection” in the next release?
Thanks for any feedback.
StefanParticipantHello Yutaka,
many thanks for feedback, very appreciated!
Unfortunately I do not understand.
As you may know already very well
$(Dir) or better ${Dir} will return the path of the current open document.
Whereas ${EE_PATH} would point always to the folder where the EmEditor.exe is in.
So unfortunately this will not help me much ;-)
So I still wants you to consider to implement this new parameters
${EE_PATH} = path to EE folder
${EE_DRIVE} = drive letter from which EE is currently started.That are standard parameters to work always portable,
no matter where EmEditor is installed or which drive letter
the USB thump drive have gotten this day.Thank you.
I hope I have not missed something obviously?
Yutaka wrote:
but ${EE_PATH} is $(Dir).
StefanParticipantThanks Yutaka, this tool works on Win7 64-bit too.
Command: .eehelptool.exe
Arguments: ._DOKUAutoHotkey.chm $(WordText)I can utilize it as snippet too.
But only with #cmd:
`#cmd X:EmEditoreehelptool.exe X:EmEditorAHKAutoHotkey.chm ${WordText}`Unfortunately it doesn’t works with ShellExecute:
`- X:EmEditoreehelptool.exe X:EmEditorAHKAutoHotkey.chm ${WordText}`The command executes (i can tell from task manager)
and the output panel opens, EE is busy… that’s all.But i want to use ShellExecute to be able to use relative paths:
`- eehelptool.exe AHKAutoHotkey.chm ${WordText}`Any suggestions please?
Do I something wrongly?.
April 3, 2013 at 8:25 am in reply to: need to delete OR extract using bookmark BETWEEN the KNOWN start&end word #10904StefanParticipantbtw
the easter egg of EmEditor is Tools > All Commands…
:-D
April 3, 2013 at 6:39 am in reply to: need to delete OR extract using bookmark BETWEEN the KNOWN start&end word #10901StefanParticipantHi,
you are welcome!
>However, @ 1st, it doesn’t work,
Yes i know, that’s called “learning by doing”.
That way you will recognize it better rather
then I had provided you to the whole solution.>is it SAFE to enter the value very high (I mean 100 for example).
Yes it will be save, especially since you limited it
by utilizing the non-greedy modifier.
Only with even higher value on looong documents
on older computers from the nineties this would
be an issue i guess..
April 3, 2013 at 5:23 am in reply to: need to delete OR extract using bookmark BETWEEN the KNOWN start&end word #10899StefanParticipant.
In the find dialog click at Customize…
and enable “[X] Regular Expression can match new line characters”
Than just RegEx search for “Deep.+thumb up.”
If you have more then one of such block in the document, then
search non-greedy “Deep.+?thumb up.” to select only one block at time.—
OR prefix your expression by “(?s)”
“(?s)Deep.+?thumb up.”It’s like the JAVA pattern DOTALL
to allow the dot to match newline characters, too.Or the perl single-line modifier ‘s’ which treats a string as single line.
That is, change “.” to match any character whatsoever,
even a newline, which normally it would not match.—
An other trick is to utilize [sS] to match any character:
“Deep[sS]+?thumb up.”Read more at http://www.regular-expressions.info/reference.html
.StefanParticipantStefan wrote:
(Maybe show the first 8 lines only. I will take care to ad a few comments at the top of the snippet for that.)
Currently the preview of the TEXT field shows the first six lines.
But for some snippets, used to show an text as help in a tool tip only,
i have the need to see the whole text as tool tip.
(like it shows in the document after i have typed the trigger)Question:
Could there be a check box in the snippet properties box to enable that?.
StefanParticipant.
Please try to find better subject lines for your threads
and use different threads for different kind of topics..
To do most of this, best learn Regular Expressions.
For example on:
– delete everything included in brackets (xxx) including the (brackets) themselvesFind: (.+?)
Replace:
[X] Use Regular Expressionswill match first
(xxx)
and then
(brackets)due to the ‘?’ regex parameter.
—
Whereas
Find: (.+)
Replace:
[X] Use Regular Expressionswill match whole
(xxx) including the (brackets)– – –
For [ and ]
useFind: [.+]
Replace:
[X] Use Regular Expressions– – –
– delete everything after the first ( in everyline, including the bracket itself
Try
Find: (.+$
Replace:
[X] Use Regular Expressions– – –
– delete double or more spaces (not tabs) and replace them with one space
Try
Find: ~~+
Replace: ~
[X] Use Regular Expressions(instead of ‘~’ enter an blank each)
– – –
To create a macro try to utilize
– “Macro > Start”
– do the work, here the find and replace job
– “Macro > Stop”
– “Macro > Edit” –> you will see the macro code to reuse
(you may want to read the help about e.g. “eeFindSaveHistory” and remove this from the macro)– – –
For the other questions *I* suggest you to open different threads
for each topic to not mix up all the answers and queries and for an back._
StefanParticipant.
Take a look into the downloaded archive:
there are no settings file in, which could overwrite anything.
But there are also the file templates. You may want to take care
if you have modified such templates before for your own needs.Basically just
– close EmEditor
– (copy folder with current version to an save place,
in case new versions contain fresh bugs, or something went wrong)
– if you have altered one of the template files yourself, copy them
– unpack the archive
– overwrite your EmEditor folder with new files
Done..
StefanParticipant.
Ah, i see. To bad.
Thank you for the clarification.
.
StefanParticipant.
Hi Yutaka, i think you know that i already utilize the snippets a lot.
But i don’t know how i can wait for a key press.
Basically i want to
– start a macro
– wait for the user pressing any key
– store that key to a variable
– continuing the macroI have many ideas to use this.
If you happen to know how i can do this
right now, please tell me by an example.If it is not possible right now,
please consider to implement something like “GetKeyPress();”Thank you.
StefanParticipantOK, thank you.
.
StefanParticipantYutaka wrote:
Environment variables are not supported for the Backup folder. If this is something you desire, I will add this feature in future versions.Well, since i use EmEditor portable
i just want to make this path portable too,
and pointing it e.g. to user profile folder
(You know: no matter if user is stefan or admin)
Or to a other partition which is defined by
an own created env var \%Backups\%.But at least we can use relative paths here:
[ .Backups ]So i can life with that but to make EmEditor even more portable
i want to suggest to respect this fact on all places.
So,… if you find some time to implement this it would be appreciated .Yutaka wrote:
By the way, this is not a plug-in feature, but rather an EmEditor core feature.Yes, sorry, i have just clicked the wrong forum by accident.
Please move it if you want.Thank you.
StefanParticipant.
Thanks for answers. But it seems i don’t get it.
Hi Yutaka,
i know i can organize My Macros contents from the
Customize Macros dialog – My Macros tab. Thank you.My point is that i do not understand why i have to add a macro
to My Macros first, if i just want to add a macro to a menu?e.g.
I utilize “Tools > Customize Menu…” and want to add a macro.
But for “Command” i can only chose a macro from My Macros.
So i have to first add my macro to My Macros.
This way i have the macro two times; one time
in My Macros and one time in my menu.The same suggestion for “Tools > Properties > [Keyboard]”
to assign a keyboard shortcut to a macro.
Why do i have to add a macro first to My Macros?That is why i asked to utilize a macro even it is
not in My Macros but directly from folder.Advantage:
1.) The My Macros list is not filled with unwanted items.
2.) I save an step for adding a macro to an menu or assign an hotkey.YE> I need to keep all compatibilities between old and new versions,
OK, i understand that.
But just an additional “Select Macro from folder…” item
in the dialogs can not be that evil?
Or would it break that much the concept?Or can we organize macros in sub-folders?
So that the sub folders are shown in the My Macro menu too?.
StefanParticipant.
Ahh, just forgot:
while GetKey() is waiting,
the keypress should not be
processed to the document
but only to the macro.That means:
if i have a selection
this should not get dropped
by the key press.
OTOH, i could catch the selection
from the macro too before waiting for the key!?!?StefanParticipant.
I had that again.
I wanted to add a macro to an menu
but could that only with macros listed in My Macros.Why?
Why can i not just select a macro from an folder?
.
January 24, 2013 at 6:43 pm in reply to: How to retrieve the first clip when system clipboard is non-text? #10790StefanParticipant.
If you code yourself,
maybe this snippet will point you to the right direction:Snippet plugin > General > Clipboard History
.
StefanParticipant.
You can extend EmEditor yourself.
Just save a macro, add to My Macros, add an shortcut.
(or use Snippet plugin)A macro could look like:
SwapWithLineAbove.jsee
document.selection.SelectLine(); //select line with cursor
cLine = document.selection.text; //store line to var
if(cLine.indexOf("n") < 0){cLine = cLine + "rn";}
document.selection.Delete(); //delete line
document.selection.LineUp(); //move cursor up one line
document.write(cLine); //paste line from var
or
MoveLineUp_(on-and-on).jsee
(assign to Shift+Alt+U)
document.selection.SelectLine(); //select line with cursor
cLine = document.selection.text; //store line to var
if(cLine.indexOf("n") < 0){cLine = cLine + "rn";}
document.selection.Delete(); //delete line
document.selection.LineUp(); //move cursor up on line
document.write(cLine); //paste line from var
document.selection.LineUp(); //move cursor up one line
and
MoveLineDown_(on-and-on).jsee
(assign to Shift+Alt+D)
document.selection.SelectLine(); //select line with cursor
cLine = document.selection.text; //store line to var
if(cLine.indexOf("n") < 0){cLine = cLine + "rn";}
document.selection.Delete(); //delete line
document.selection.LineDown(); //move cursor down one line
document.write(cLine); //paste line from var
document.selection.LineUp(); //move cursor up one line
– – –
Swap Lines UpSideDown.jsee
FROM:
1 – x
2 – Y
3 – Z
TO:
3 – Z
2 – Y
1 – x
Sel = document.selection.text;
SelArr = Sel.split("rn"); SelArr.reverse();
for(i=0,L=SelArr.length; i<L; i++){
document.selection.text = SelArr[i];
if(i<L-1){document.selection.text ="rn";}
}
.
StefanParticipantFine you got it.
Another tip is to google for an answer:
google: [ emeditor Large File Controller ]
to find e.g.
http://www.emeditor.com/modules/feature1/rewrite/tc_13.html
http://www.emeditor.com/modules/tutorials4/index.php?id=2.
StefanParticipantEmEditor Help
– Command Reference
– View category
> Toggle Large File Controller commandStefanParticipantWhat have you done?
Step by step.– – –
Also you may want to change my code
str = document.GetLine( yLine );
to
str = document.GetLine( yLine ).toLowerCase();
because indexOf is case sensitive.
.
StefanParticipant.
* open EmEditor
*
* open a new document
* paste the script in
* save as e.g. Untitled.txt
* click at “Macros > Select This”
*
* open your source document
* put your cursor in ONE line
* execute “Macro > Run Untitled.txt”
* you should be prompted with “delete/all ok/nothing found” depending on the line content
*
* check for each line if the script works for you
* if yes, the next step is to build a loop over all lines
and at last exchange the “delete” message with an find&delete codeHere the proof of concept code again
but with comments:
//settings:
openTag = "<span";
closingTag = "</span";
//get current line number:
yLine = document.selection.GetActivePointY( eePosLogical );
//get line content:
str = document.GetLine( yLine );
//search for occurrences in this line:
openTagPos = str.indexOf(openTag);
closingTagPos = str.indexOf(closingTag);
//if an closing tag is found:
if(closingTagPos > -1){
//if no opening tag is found at all
//OR
//if closing tag is found before the first opening tag
if(openTagPos == -1 || (closingTagPos < openTagPos)){
//<here find first closing tag and remove it>
alert(closingTag + " to delete found");
}else{
//nothing to do in this line. This code can be removed.
alert("lines is ok");
}
}else{
//nothing to do in this line. This code can be removed.
alert("not found " + closingTag);
}
- AuthorPosts