Question: "save the active file" command

I am planning to use the "schedual task" in windows to try to launch
maple in the background (run under some different user account)
to do some computations.

For this pupose I have designed a little counter that is located in the
Start up code region:

for i from 0 to 100 do
if DataTable1(1, 1)=i then DataTable1(1,1):=i+1:  break; end if:
end do:

the DataTale will tell me how many times the worksheet has been opened
just to check that the schedualer is doing it jobb.

Apperently in the "schedual task" in windows you can also set how long the
software should be running. Maybe I should set that to 5 minutes.

Now in order for all this to work the last thing that needs to happens is that
the worksheet is saved. Since windows will be launching maple I need a
save-active-worksheet command (like ctrl+s) that must go after:

for i from 0 to 100 do
if DataTable1(1, 1)=i then DataTable1(1,1):=i+1:  break; end if:
end do:
# preferably here

Then that nasty star disappears and windows can simply close maple
otherwise a pop up menu will come asking me if I want to save the worksheet
which I am assuming square windows will not be answering

What save command should I use? I mean If I was there I could simply push
ctrl+s but unfortunatly I am not there


later comment; It would be nice if there existed a "save-and-close" command
then I dont have to schedual the closing of the program either.


Please Wait...