Hi
Aaron,
You do come up with some interesting challenges...
My macro files (and backup copies of them) are found in:
C:\Documents and Settings\myusername\Application Data\Macro Scheduler
If you don't find them there, you might try:
C:\Program Files\MJT Net Ltd\Macro Scheduler
And if you still can't find where they are, just use file explorer to search for all *.scp files on your hard drive and it should find them.
Yes, I would highly recommend you keep backups turned on. A few times I have gone in and made changes to a macro, saved (or so I thought), ran the macro to test, it contains a coding error so it locks up or dies in some strange way... and then I've found the text of my macro has vanished.
Now if I didn't have backups turned on, I'd be ticked. As it is, I just open the most recent backup file (macroname.001 or whatever), copy the text, open the now-empty macro in Macro Scheduler Advanced Editor and paste the whole macro back in, no harm done.
How often does this happen? Very rarely these days... twice a year perhaps. And to be fair, it could even be one of my own macros being triggered and deleting the text. If I ever find out how to replicate the problem I'll post the steps for Support but until then, the backup setting is staying on.
You seem to be trying to make a macro that will log the names of macro files you've changed and the dates you've changed them as a sort of programming exercise... is that right?
I would guess your code stops working for the same reason Marcus guessed, because the editor window may not always have Script_05 open in it. Do you only care about logging changes made to just that particular macro? Or are you looking to log changes made to all macros?
If all macros, does each macro get its own separate change log file or are you dropping everything into one huge log file?
You said you wanted to actually write the changed lines to the logfile along with the line number if possible. What about deleted lines or brand new lines? How would you log those? How would your macro zero in on just the one line that changed and write only that line to the log file? And what part of it changed? Would you want to write both the OLD LINE and the NEW LINE one after the other into the logfile so you could see the before and after? It gets complex in a hurry.
Turning on backups takes care of all this automatically, saving a complete copy of a macro file every time you make (and save) a change. For any macro you've updated 3 times or more, you'll have the current version, say "macro.scp" and "macro.001", "macro.002" and "macro.003".
Let us know what you try next. Bob's idea is certainly interesting...