pecloe Posted August 24, 2005 Posted August 24, 2005 Good afternoon I am a brand spank'in new user and all I can say is I'm in awe! I'm missing something real basic here maybe someone will help. I've written a short script to open a txt file that changes constantly. My goal is to move the cursor to the end of the text and add a @lf or @cr so I can start typing on a new line. I sure am enjoying this, great forum! Is the "exit" needed? Thank you Pecloe Run('C:\Windows\Notepad.exe "C:\Documents and Settings\One\Application Data\Log Files\Log.txt"') WinWaitActive("Log.txt - Notepad") send("{pgdn}") exit
BigDod Posted August 24, 2005 Posted August 24, 2005 Not ideal but this will work. Run('C:\Windows\Notepad.exe "d:\temp\Log.txt"') WinWaitActive("Log.txt - Notepad") send("^{end}") send("{enter}") exit Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
pecloe Posted August 24, 2005 Author Posted August 24, 2005 Not ideal but this will work.Run('C:\Windows\Notepad.exe "d:\temp\Log.txt"') WinWaitActive("Log.txt - Notepad") send("^{end}") send("{enter}") exit <{POST_SNAPBACK}>Thank you BigDod!
Gigglestick Posted August 24, 2005 Posted August 24, 2005 No, the Exit is not required, but it's a good idea to use for others' reference, especially in a large, complicated script with many functions. My UDFs: ExitCodes
Gigglestick Posted August 24, 2005 Posted August 24, 2005 Also, you say the file changes constantly. Are you attempting to see these constant changes? Notepad doesn't have any changed-file notification, so it's not a good option. Check out PSPad or something else. I think ScriptWriter might do it also. They will notify you when the file has changed, or automatically reload when it's changed. Otherwise, you could create a GUI with an edit box and have your script read the new lines every so often. My UDFs: ExitCodes
pecloe Posted August 24, 2005 Author Posted August 24, 2005 Also, you say the file changes constantly. Are you attempting to see these constant changes? Notepad doesn't have any changed-file notification, so it's not a good option. Check out PSPad or something else. I think ScriptWriter might do it also. They will notify you when the file has changed, or automatically reload when it's changed.Otherwise, you could create a GUI with an edit box and have your script read the new lines every so often.<{POST_SNAPBACK}>HelloThe file is a log of changes and notes I make myself so I know when it changes. Its nice to open the log and read or write from last entry. I ended up with the script below and thats exactly what I needed. For some reason CTRL+end was not on my list of windows shortcuts.Thanks to allpecloeRun('C:\Windows\Notepad.exe "C:\Documents and Settings\One\Application Data\Log Files\Log.txt"')WinWaitActive("Log.txt - Notepad")send("^{end}")exit
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now