Register forum user name Search FAQ

SaveNotepad

Script function

world.SaveNotepad

Read about scripting

Type

Method

Summary

Saves a notepad window to disk

Prototype

long SaveNotepad(BSTR Title, BSTR FileName, BOOL ReplaceExisting);

View list of data type meanings

Description

This saves an existing notepad window to disk.

Title - title of the notepad (used in functions like AppendToNotepad)

FileName - name to save to disk as.

If the file name is empty (ie. "") then it will be saved under its existing file name, if any, or you will be prompted for the name to save it as.

ReplaceExisting:

If true - the specified file name becomes the "default" file name for the file. In other words, if you subsequently save from the GUI interface it will automatically use that file.

If false - saves the file under the name you specify, however the "default" file name is unchanged.


WARNING - if a file of the same name exists on disk it will be overwritten, regardless of the ReplaceExisting flag value.

SECOND WARNING - versions 4.13 and earlier of MUSHclient returned 0 on a good save and 1 on a bad save. From version 4.14 onwards it returns 0 on a bad save and 1 on a good save.


Available in MUSHclient version 3.29 onwards.



VBscript example

world.SaveNotepad "my_notepad", "c:/mushclient/notepad.txt", 0


Jscript example

world.SaveNotepad ("my_notepad", "c:/mushclient/notepad.txt", 0);


PerlScript example

$world->SaveNotepad ("my_notepad", "c:/mushclient/notepad.txt", 0);


Python example

world.SaveNotepad ("my_notepad", "c:/mushclient/notepad.txt", 0)


Lua example

SaveNotepad ("my_notepad", "c:/mushclient/notepad.txt", 0)


Lua notes

The ReplaceExisting flag is optional, and defaults to false.


Return value

1 = saved OK
0 = not saved


See Also ...

Topic

Notepad

Functions

(ActivateNotepad) Activates a notepad window
(AppendToNotepad) Appends text to a notepad window
(CloseNotepad) Closes a notepad window
(GetNotepadLength) Gets the length of the text in a notepad window
(GetNotepadList) Gets the list of open notepads - returning their titles
(GetNotepadText) Gets the text from a notepad window
(MoveNotepadWindow) Move and resize the specified notepad window
(NotepadColour) Changes the text and background colour of the selected notepad window
(NotepadFont) Changes the font and style of the selected notepad window
(NotepadReadOnly) Make a selected notepad window read-only
(NotepadSaveMethod) Changes the save method for this notepad window
(ReplaceNotepad) Replaces text in a notepad window
(SendToNotepad) Creates a notepad and sends text to it

(Help topic: function=SaveNotepad)

Documentation contents page


Search ...

Enter a search string to find matching documentation.

Search for:   

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.