• Login
Community
  • Login

Is it possible to record macro to enter current date?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 4 Posters 1.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    JasonCh11
    last edited by Sep 10, 2022, 10:38 AM

    Hi,

    I have a macro for search and replace. Is it possible to edit the macro to enter current date without plugins?

    Cheers

    A 1 Reply Last reply Sep 10, 2022, 1:25 PM Reply Quote 0
    • A
      Alan Kilborn @JasonCh11
      last edited by Alan Kilborn Sep 10, 2022, 1:26 PM Sep 10, 2022, 1:25 PM

      @JasonCh11

      Yes.
      Suggest you see the user manual section on hand-editing configuration files, HERE .
      Or…re-record your base macro and put the insert-date command in the sequence where you need it.

      J 1 Reply Last reply Sep 10, 2022, 2:28 PM Reply Quote 1
      • J
        JasonCh11 @Alan Kilborn
        last edited by Sep 10, 2022, 2:28 PM

        @Alan-Kilborn I did read the manual but there’s no variable for date.

        A 1 Reply Last reply Sep 10, 2022, 2:36 PM Reply Quote 0
        • A
          Alan Kilborn @JasonCh11
          last edited by Sep 10, 2022, 2:36 PM

          @JasonCh11 said in Is it possible to record macro to enter current date?:

          there’s no variable for date

          Not exactly sure what this means…

          Record and save a throwaway macro for inserting a date/time (on the Edit (menu) > Insert submenu.

          Then look at the macro that N++ creates, possibly merge that text manually into a larger macro you already have existing, delete the throwaway, etc…

          1 Reply Last reply Reply Quote 1
          • R
            Rufus Smith
            last edited by Sep 10, 2022, 6:53 PM

            Why “without plugins”?
            I use the Python Script plugin with which you can do amazing things in python. And yes, I have created a timestamp button which inserts the current date and time at the cursor position using it. I don’t understand why you want to do it without plugins.

            1 Reply Last reply Reply Quote 0
            • G
              guy038
              last edited by guy038 Sep 10, 2022, 7:11 PM Sep 10, 2022, 6:59 PM

              Hello, @jasonch11, @alan-kilborn, @peterjones and All

              @jasonch11, as @alan-kilborn advice you, you can use the 3 N++ native options :

              • Edit > Insert > Date Time (short)

              • Edit > Insert > Date Time (long)

              • Edit > Insert > Date Time (customized)

              If you choose the third option, you can customize the date format in Settings > Preferences... > Multi-Instance & Date !

              Of course, with the Shortcut Mapper, you may assign any available shortcut to these 3 options

              OK with N++ 8.4.4 :

              Notepad++ v8.4.4   (64-bit)
              Build time : Jul 15 2022 - 17:54:42
              Path : E:\844_x64\notepad++.exe
              Command Line : 
              Admin mode : OFF
              Local Conf mode : ON
              Cloud Config : OFF
              OS Name : Windows 10 Pro (64-bit) 
              OS Version : 21H2
              OS Build : 19044.1949
              Current ANSI codepage : 1252
              Plugins : 
                  mimeTools (2.8)
                  NppConverter (4.4)
                  NppExport (0.4)
                  ComparePlus (1)
              

              Best Regards,

              guy038

              P.S. :

              Oh, @jasonch11, I misunderstood your goal ! So, follow the @alan-kilborn advice and merge the date insertion parameters, somewhere in your macro containing the S/R process !

              R 1 Reply Last reply Sep 10, 2022, 7:18 PM Reply Quote 1
              • R
                Rufus Smith @guy038
                last edited by Sep 10, 2022, 7:18 PM

                @guy038 You reminded me why I didn’t need my python plugin recently! I have been using that edit/insert/date and forgot about it! A lot of cool plugins are now incorporated in notepad, like sort/compare/etc…

                1 Reply Last reply Reply Quote 0
                7 out of 7
                • First post
                  7/7
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors