Jump to content
Sign in to follow this  

Saving a text document

Recommended Posts

Hi, :">

I'm new to scripting. I can program in C, but this is a total new ball game to me. Any help is much appreciated.

First of all, I read the tutorial on this website on opening a text file, write something in it and then close it. Now, what if I wanted to save it in a specific directory?

So I got to here:

WinWaitActive("Untitled - Notepad")
Send("This is a test...")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad", "The text in the Untitled file has changed")
WinWaitActive("Save As")
ControlClick("Save As", "Save &in:", "", "Desktop")
Send("notepad_test.txt","File name:")

But obviously that didn't work. I can save the file to default directory just fine, but not on my desktop (or wherever I wanted it to be). I've looked at 20 or so pages in the search but found nothing.

I know the error is "ControlClick" but I don't know how to direct the mouse to choose "Desktop". Any help is much appreciated.


Share this post

Link to post
Share on other sites

better to save it and then copy/move it to any folder you want...




Copies one or more files.

FileCopy ( "source", "dest" [, flag] )


source The source path of the file(s) to copy. Wildcards are supported.

dest The destination path of the copied file(s).

flag [optional] this flag determines whether to overwrite files if they already exist.

Can be a combination of the following:

0 = (default) do not overwrite existing files

1 = overwrite existing files

8 = Create destination directory structure if it doesn't exist (See Remarks).



Share this post

Link to post
Share on other sites

Thank you so very much from the both of you, especially with the quick response.

got it to work beautifully. Continue learning... :shocked: from the first script that is.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...