[Home] [Downloads] [Search] [Help/forum]

MUSHclient scripting

Description of MUSHclient world function: world.SaveNotepad


Name SaveNotepad
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.


Note: Available in 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.
Returns 1 = saved OK
0 = not saved
Introduced in version 3.29

See also ...

Function Description
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
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

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]