Automate blank space on or carriage return
-
Macros are simple keystroke/menu replicators; they have no concept of time.
You can see our FAQ on automating Notepad++ to find out more about what macros can and cannot do, and what options there are for you when macros are not sufficient for your task.
-
@PeterJones thanks for getting in touch. I appreciate macros have no concept of time. Is it there possible to write a macro or automate the moving of the cursor in Notepad ++
-
“cursor” can have two meanings – the typing cursor (known as the “caret” in Notepad++ and other text editing environments) and the mouse cursor (the “pointer”).
You cannot use a macro to move the pointer. You can easily use a macro to move the caret.
If you use the arrow keys to move the caret while recording the macro, it will record those caret movements, because it’s recording those arrow-key keystrokes (or, technically, the command that is issued when you hit those keys). And you can also record the typing of a character (like the newline sequence when you hit ENTER) because that’s a keystroke.
Macros record keystrokes (like typing or arrowing) and menu commands.
I guess I need to clarify that in the FAQ slightly.update: I have clarified the FAQ to explain in more detail what “Notepad++ actions” mean, because the old parenthetical definition was too ambiguous -
@PeterJones , so the question then becomes, is it possible to the keystroke to run continuously?
-
@Carlton-Patterson said in Automate blank space on or carriage return:
possible to the keystroke to run continuously
You cannot make a macro truly loop forever. There would be no useful macro function that would do such a thing – macros make immediate changes, and so a macro that ran continuously would make continuous changes, which is nonsensical. If you want to trigger some event when specific text is entered, you would need one of the scripting plugins, not the macro feature.
As the FAQ said (I am still not convinced you’ve read the FAQ), Macros don’t have an internal looping construct. You can use the Macro > Run a Macro Multiple Times to run it a specific number of times, but that’s not the same thing as “continuously”.
You still appear to be trying to think of the macro as a true programming language: it is not! If you want your automation task to do anything more than “run this set of commands once” or “run this exact set of commands a specific number of times”, then you need to switch away from macros and move to a scripting plugin. If you want it to change behavior between each loop, macros cannot do that. If you want it to increment a counter and use that counter, macros cannot do that. If you want “if” statements or “delay” statements, macros cannot do that. I don’t see how I can say that any more clearly, whether in the FAQ or here.
Read the FAQ.
-
@Carlton-Patterson said in Automate blank space on or carriage return:
Can someone let me know if its possible to automate the creation of a blank space, say every 5mins, or a carriage return every 5 mins? If it’s not possible to automate every 5 mins, can someone let me know if its possible to automate either a blank space or carriage at all?
Sometimes solutions can be driven by further explanations.
What do you expect to achieve by this – i.e, what is its use?
I can hardly see how adding a space or a line-ending every 5 minutes is useful. -
@Alan-Kilborn Perhaps to keep a screen saver from activating.
-
@Jim-Dailey said in Automate blank space on or carriage return:
Perhaps to keep a screen saver from activating.
Then macro is not the right choice, scripting plugin is. (Or, better, a keepalive app, because Notepad++ is not designed to be used as something to keep screensavers from activating. I actually tried with PythonScript once, but it wasn’t as reliable as a standalone keepalive app.)
-
@Jim-Dailey said:
Perhaps to keep a screen saver from activating.
OK, there’s a good reason; I’d like to hear from the OP as well.
@PeterJones said:
I actually tried with PythonScript once, but it wasn’t as reliable…
Me, too; mine was SUCCESSFUL. :-)
-
@PeterJones someone helped me with my original quest with the following Python code
from time import sleep for i in range(10): # The text will be appended 10 times, put the value you need sleep(5*60) # 5 min editor.appendText("\nWHATEVER YOU WANT")
Although the code works, it doesn’t keep my screen alive. Can you think of any keep alive app as you mentioned?
-
@Carlton-Patterson said in Automate blank space on or carriage return:
Although the code works, it doesn’t keep my screen alive.
Nope, because screen savers / screen locking from the OS has to do with keyboard/mouse input, not activity inside an app.
Can you think of any keep alive app as you mentioned?
You could google “app to prevent screensaver or sleep mode” or something similar.
Or you could notice the script that @Alan-Kilborn already linked you to on the word SUCCESSFUL in his post – that script works in the PythonScript plugin, and worked for him to prevent the screensaver from activating. So you could use that script.
-
@Carlton-Patterson I have a USB device that someone purchased for a group of us at work some years ago. It randomly fakes some sort of user input that keeps the screen saver from kicking in.
I don’t know if they still make them or if there are now ways to detect and ignore/disable their effect. In any case, if you want to search for one, it is a WiebeTECH “Mouse Jiggler”.
-
@Jim-Dailey said:
I have a USB device that someone purchased…
We’re getting off-topic but I’ll just point out that a script costs less. :-)