Forum Replies Created
- AuthorPosts
- Patrick CParticipant
Regarding the macro: I`m currently stuck with the condition on the pressed shift / alt / ctrl key.
See: https://www.emeditor.com/forums/topic/modifier-key-ctrl-alt-shift-is-was-pressed/Patrick CParticipantOk I’ll try to write a Macro sometime this week and will post it here.
Many thanks for considering!Patrick CParticipantIn my case it works fine.
Copy / pasting outputted
E:\ProgDB\EmEditor\Macros\Toggle_read_only.jsee \t 0x00000000 E:\ProgDB\EmEditor\Macros\insert_date_only.jsee \t 0x00000000 E:\ProgDB\EmEditor\Macros\insert_date_time.jsee \t 0x00000000 E:\ProgDB\EmEditor\Macros\insert_date_long_time.jsee \t 0x00000000 E:\ProgDB\EmEditor\Macros\delete_between_bookmarks.jsee \t 0x00000000
Where \t is the tab character.
It looks like the \t and 0x00000000 can be omitted from the list.
Pasting allows me to run the Macro, but when trying to edit them I get your “The following files do not exist error”. → Restarting EmEditor fixes this.Patrick CParticipantThough just noticed a shortcoming: Macro shortcuts are not or only partially preserved 😐
Patrick CParticipantWow, this is ultra-useful for me because sometimes my Macros end up in a mess and this makes cleaning up a whole lot easier 😃
Many thanks to spiros for asking the question and Yutaka for answering it!
Patrick CParticipantGlad I could help 😀
Thanks for the feedback!Patrick CParticipantI use the following .jsee macro, perhaps it helps (you could assign ctrl+shift+. to the macro, I use ctrl+D, which works reliably).
var date = new Date(); var dd = date.getDate(); // returns the day of the month (from 1 to 31) if( dd < 10 ) dd = "0" + dd; var MM = date.getMonth() + 1; // returns the month (from 0 to 11)! if( MM < 10 ) MM = "0" + MM; var yyyy = date.getFullYear(); // Returns the year (4 digits) // “Output” document.write( yyyy + "-" + MM + "-" + dd);
Patrick CParticipantI’ve got an old script that gets close, perhaps it helps.
// Inspired by & resources // https://www.emeditor.com/forums/topic/option-to-adjust-the-datetime-format-edit-insert-time-and-date/ // https://www.emeditor.com/forums/topic/insert-long-date/ // https://www.w3schools.com/jsref/jsref_tolocaledatestring.asp + jsref_getmonth.asp + jsref_getdate.asp function return_date_long_time() { var date = new Date(); // var n = d.toLocaleDateString(); // old approach - unreliable // Date assembly var dd = date.getDate(); // returns the day of the month (from 1 to 31) if( dd < 10 ) dd = "0" + dd; var MM = date.getMonth() + 1; // returns the month (from 0 to 11)! if( MM < 10 ) MM = "0" + MM; var yyyy = date.getFullYear(); // Returns the year (4 digits) // time assembly var hh = date.getHours(); // Returns the hour (from 0-23) if( hh < 10 ) hh = "0" + hh; var mm = date.getMinutes(); // Returns the minutes (from 0-59) if( mm < 10 ) mm = "0" + mm; var ss = date.getSeconds(); // Returns the seconds (from 0-59) if( ss < 10 ) ss = "0" + ss; // “Output” return( yyyy + "-" + MM + "-" + dd + " " + hh + ":" + mm + ":" + ss ); } document.write( return_date_long_time() );
Patrick CParticipantSorry, not done yet.
The cursor’s colour is set analogously by the “Selection” property (second entry from top on my installation).Patrick CParticipantMenu bar:
Tools → Properties for all Configurations → Display → Scroll way down and select “Search string” → Select the […] located next to the background colour combobox.Cheers
PatrickPatrick CParticipantYes, its displayed on bottom left part of the status bar:
Menu Bar → View → Status barThe only annoying thing is that the Find/Replace dialogue will not show you the number of found strings, but it will show the number of replaced strings.
In contrast the Find (without replace) dialogue allows you to count the number of finds.*) I’ll ask Yutaka if he could add the find dialogue’s count matches tickbox to the replace dialogue.
May 28, 2022 at 1:09 am in reply to: crashes on lowercase / uppercase when the selection exceeds the line’s end #28211Patrick CParticipantHello Yutaka
Version 21.7.910
Does not crash 😀Version 21.7.1
Crashes 🙁Looking forward to the next non beta update.
Many thanks!
May 27, 2022 at 6:16 am in reply to: crashes on lowercase / uppercase when the selection exceeds the line’s end #28208Patrick CParticipantVersion 21.7.1
with ↵ denoting a new line:
foo bar↵ FOOs BARs↵ Foo Bar↵
In the above: select the block containing
bar
BARs
Bartry to change the case, e.g. lowercase
EmEditor will crash
Patrick CParticipantfigured out a ‘solution’ for [2] :
Tools → Properties for all Configurations → File → untick “Detect all”[1] might still be of interest for Yutaka
March 30, 2022 at 11:06 am in reply to: Extract each occurrence of a string into a separate line to build a list of URLs #28134Patrick CParticipantArghh, stupid me
You can do this in one stepFind in files → Extract with Regex:
(?<=")[^"]*__data\/assets.*?(?=")
With the extract option display matched strings only
😴March 30, 2022 at 10:52 am in reply to: Extract each occurrence of a string into a separate line to build a list of URLs #28133Patrick CParticipantFigured it out:
First extract the lines via find in fileThen Find → Extract with Regex:
(?<=")[^"]*__data\/assets.*?(?=")
🙂
March 30, 2022 at 10:29 am in reply to: Extract each occurrence of a string into a separate line to build a list of URLs #28132Patrick CParticipantPartial answer
You probably cannot do it in one step, but you would* be able do this in two:
First extract
and then Find -> Extract with the following Regex*
/https:\/\/.*__data\/assets.*(?=")/gU
*there is a problem here:
The syntax above is not perl compatibleDoes somebody know how to apply the /gU regex flag?
Would really appreciate thisPatrick CParticipantWith respect to: to fully replace Windows Notepad
Automatically setting file type associations under Windows 10 is no longer as simple as it used to be. Several other programs I use have also given up on this and EmEditor’s built in function also doesn’t seem to work on Windows 10.
My preferred approach to setting associations is by (text file example; ditto for .reg etc):
● Right click → Open With → Choose another app → Select your app (might require selecting the .exe’s location) + Tick “Always use this app to open .txt files”it’s settings are all over the place and it doesn’t seem to have command line support for restoring them all at once
I’m not entirely sure whether you are referring to EmEditor’s “fresh out of the box” settings or your custom settings and toolbars.
With respect to custom settings and toolbars: I agree that backing these up and restoring these is a pain. Custom macros are even worse, so I would very much welcome a more streamlined approach.
With respect to EmEditor’s default settings: Hit ctrl+Q; type “reset all” → select the “reset all settings” command and execute “run this command”Hope some of this helps.
Patrick CParticipantView → Toolbars → CSV Toolbar
you’ll notice that there are four default CSV profiles to choose fromit might help to think of CSV, TSV,… as *SV i.e. each of them can be configured freely
to configure:
Tools → Customise → CSVJuly 5, 2019 at 10:37 am in reply to: Multiple-line string as a search string in the Find/Replace dialog box #25953Patrick CParticipantTip: My preferred tool for testing out and learning regex is
regex101 dot comJuly 5, 2019 at 10:37 am in reply to: Multiple-line string as a search string in the Find/Replace dialog box #25952Patrick CParticipantWelcome to the regex kitchen stew (semi serious; regex seems to drive most people I know either mad or desperate or both)
Anyway one possible RegEx for finding 2 or 4 but not 24 is:
(2(?!4)|(?<!2)4)Which works on
1
2
3
09
4
5
24
51
1,2,3,09,4,5,24,51,4,2,42,8,4,6,2,8
2
4To get an idea on what this does
(a|b)
finds either a or b, where
a = 2(?!4) finds 2 without a trailing 4
b = (?<!2)4 finds 4 without a leading 2Note that I’m not a regex guru.
July 3, 2019 at 12:28 pm in reply to: Multiple-line string as a search string in the Find/Replace dialog box #25939Patrick CParticipantI’m really short on time and its not the complete answer, but the regex for finding 2 or 4 is:
[24]This will however, select only one of the characters at a time.
July 2, 2019 at 9:24 am in reply to: On launch automatically open files that were open when last closing the program #25934Patrick CParticipantTools → Customise → Workspace → Automatic Workspace: Save, Restore and Keep Undo Information, and No Prompt to Save Files
http://www.emeditor.org/en/dlg_customize_workspace_index.htmlPatrick CParticipantInteresting I haven’t got this behaviour.
Have you tried setting
Tools → Customise Menus… → Delay time
to 0.0 seconds ?Cheers
PatrickPatrick CParticipantThank you Yutaka!
- AuthorPosts