Jump to content

Recommended Posts

Posted

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

Posted

Not ideal but this will work.

Run('C:\Windows\Notepad.exe "d:\temp\Log.txt"')

WinWaitActive("Log.txt - Notepad")

send("^{end}")
send("{enter}")

exit

:whistle::dance::dance:


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

Posted

Not ideal but this will work.

Run('C:\Windows\Notepad.exe "d:\temp\Log.txt"')

WinWaitActive("Log.txt - Notepad")

send("^{end}")
send("{enter}")

exit

:whistle:  :dance:  :dance:

<{POST_SNAPBACK}>

Thank you BigDod!
Posted

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

Posted

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}>

Hello

The 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 all

pecloe

Run('C:\Windows\Notepad.exe "C:\Documents and Settings\One\Application Data\Log Files\Log.txt"')

WinWaitActive("Log.txt - Notepad")

send("^{end}")

exit

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...