boristhemoggy Posted March 23, 2017 Report Share Posted March 23, 2017 After about 2 years of using the same Notepad file to pop a macro into, suddenly 1 line of the 3 lines of text in the macro do not paste. I open a brand new Notepad file, and it pastes perfectly. I use the old one and it won't paste the middle line. So, I open a brand new notepad file, copy and paste all of the stuff from the old one, then go to use the macro again and ...middle line missed out! It's so weird! Other macros paste fine. I hope someone can come up with an explanation cos it's driving me nuts. Quote Link to comment Share on other sites More sharing options...
rberq Posted March 23, 2017 Report Share Posted March 23, 2017 Not sure what you mean by "pop a macro into" a file. Can you be more specific about what text you are pasting? Where does the text come from? Maybe show us the relevant macro commands that are failing? Quote Link to comment Share on other sites More sharing options...
boristhemoggy Posted March 23, 2017 Author Report Share Posted March 23, 2017 Sorry, I'm surprised you can't read what I'm saying but... A macro can hold text, so that when you press a key that text is pasted into something that can display text, such as a notepad file. The text I am pasting is just text, literally, just words. The text comes from the text that is held in the macro. The macro file is made up of Clipboard start copy "My Text" Clipboard end copy Clipboard paste Text type <ENTER> Clipboard start copy "My Text 2" Clipboard end copy Clipboard paste Text type <ENTER> Clipboard start copy "My Text 3" Clipboard end copy Clipboard paste Text type <ENTER> It is "My text 2" which is failing to paste, as in, the text held as "My text 1" and "my text 3" is pasting into the notepad file, however "My text 2" does not. Unless I open a new notepad file, and then it does. As I say I've been using this system with the same files for over 2 years with no problem. Quote Link to comment Share on other sites More sharing options...
Samrae Posted March 23, 2017 Report Share Posted March 23, 2017 1 hour ago, boristhemoggy said: Sorry, I'm surprised you can't read what I'm saying but... I did not understand either until you explained further. I have no idea why it used to work and does not now work. Perhaps it is caused by a Windows update or installing a new application. Have you rebooted your computer recently? Here are some ideas to try: 1. Try increasing the Delay after clipboard commands found in Options, Preferences, Delays. By default this is 250. Try a very large value, perhaps 1500, to see if it helps and then reduce the value. 2. Add Delays: Clipboard start copy "My Text" Clipboard end copy Delay 1 Seconds Clipboard paste Text type <ENTER> Clipboard start copy "My Text 2" Clipboard end copy Delay 1 Seconds Clipboard paste Text type <ENTER> Clipboard start copy "My Text 3" Clipboard end copy Delay 1 Seconds Clipboard paste Text type <ENTER> Again, use large delays to see if it helps and if it does help reduce the amount of delay. 3. I do not use the Clipboard start copy and Clipboard end copy commands. This is how I would write this sample macro: Text Type: My Text Text Type: <ENTER> Text Type: My Text 2 Text Type: <ENTER> Text Type: My Text 3 Text Type: <ENTER> Inside the Text Type commands that include My Text click the box that says "Use Clipboard to Paste Text". You may still need some small delays. I usually need to add delays after typing <ENTER>: Text Type: My Text Text Type: <ENTER> Delay 0.1 Seconds Text Type: My Text 2 Text Type: <ENTER> Delay 0.1 Seconds Text Type: My Text 3 Text Type: <ENTER> Delay 0.1 Seconds Quote Link to comment Share on other sites More sharing options...
boristhemoggy Posted March 23, 2017 Author Report Share Posted March 23, 2017 Well the 1500 in delay in options works! The other delay does not. However it's given me some ideas to play with. Thanks a bunch! Quote Link to comment Share on other sites More sharing options...
rberq Posted March 23, 2017 Report Share Posted March 23, 2017 Sam's suggestions are very good. Text Type will likely be more reliable for you. You may want to set keystroke timing at the beginning of your macro. I generally include the following two default timing commands at the beginning of every macro: Keystroke Speed: 30 Milliseconds Mouse Speed: 30 Milliseconds Clipboard commands are notoriously sensitive to timing. I suspect that is because the Windows operating system is involved If Windows is busy doing something else a clipboard command may take much longer than usual to complete. The macro may work fine 95 times out of 100 but fail the other 5 times. Paste, or Ctlr-v, can also be unpredictable in some applications, though Notepad should not be a problem. However, I could not get your example macro to fail even though I have the Options for clipboard delay set to zero. Quote Link to comment Share on other sites More sharing options...
boristhemoggy Posted March 23, 2017 Author Report Share Posted March 23, 2017 I wish I could show you video, it is very bizarre! I have now set the macro up as Sam said and it does not even need time delay at the moment. This has worked flawlessly for years, it is possible that a very large file may cause the problem? It still works perfectly as it was on a new notepad file. Quote Link to comment Share on other sites More sharing options...
rberq Posted March 23, 2017 Report Share Posted March 23, 2017 That was my first thought, to wonder if the Notepad file was very large. I guess I should have asked that to begin with, though that would have done no good -- obviously you didn't want an answer like "Use a smaller file." It seems very likely file size could be involved, though don't ask me why. Stick with Sam's solution, possibly with the addition of the Keystroke Speed command I suggested. Quote Link to comment Share on other sites More sharing options...
boristhemoggy Posted March 23, 2017 Author Report Share Posted March 23, 2017 You're right I can't work with a smaller file. The point of the file is that it holds data, even historical data. For now all is good, I much appreciate the help from you all. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.