Jump to content
Sign in to follow this  
pecloe

Brand New Quick Question

Recommended Posts

pecloe

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

Share this post


Link to post
Share on other sites
BigDod

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:



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites
pecloe

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!

Share this post


Link to post
Share on other sites
Gigglestick

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

Share this post


Link to post
Share on other sites
Gigglestick

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

Share this post


Link to post
Share on other sites
pecloe

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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.