Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

scriptEditorInfo([clearHistory=boolean], [clearHistoryFile=boolean], [historyFilename=string], [input=string], [suppressErrors=boolean], [suppressInfo=boolean], [suppressResults=boolean], [suppressStackWindow=boolean], [suppressWarnings=boolean], [writeHistory=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

scriptEditorInfo is undoable, queryable, and editable.

Use this command to directly manipulate and query the contents of the Command Window window.

Note: Due to recent changes, certain flags will no longer work on the Script Editor Window. All flags will continue to work with the CommandWindow (old Script Editor).

Note: This command cannot be used to create a new script editor window.

Return value

stringThe name of the Command Window window is returned.

In query mode, return type is based on queried flag.

Flags

clearHistory, clearHistoryFile, historyFilename, input, suppressErrors, suppressInfo, suppressResults, suppressStackWindow, suppressWarnings, writeHistory
Long name (short name) Argument types Properties
clearHistory(ch) boolean edit
Clears the read-only text in the upper field of the Command Window.
clearHistoryFile(chf) boolean edit
Clear the file defined by the -hf/historyFilename flag, but only if -wh/writeHistory is true. Use this flag to start a new history file, since the default behaviour of the Command Window is to append to the existing file.
historyFilename(hfn) string queryedit
Sets or returns the name of the file that the Command Window will use to echo all of its history to. If this is an empty string when the -wh/writeHistory flag is set to true, then it will automatically be set to the default file.
input(i) string edit
Sets the text in the lower field of the Command Window. Set this value to an empty string to clear the field. Note: this flag only affects the Command Window and not the new script editor. To find out how to manipulate the new script editor please refer to the documentation on the cmdScrollFieldExecuter and cmdScrollFieldReporter.
suppressErrors(se) boolean queryedit
When true, Command Window and Script Editor will not display error messages.
suppressInfo(si) boolean queryedit
When true, Command Window and Script Editor will not display info messages generated by Maya.
suppressResults(sr) boolean queryedit
When true, Command Window and Script Editor will not display command results.
suppressStackWindow(ssw) boolean queryedit
When true and when the stackTrace mechanism is on, this flag will suppress the display of the stack window. If stack trace is enabled then results will be returned to the output window instead of a separate stack window.
suppressWarnings(sw) boolean queryedit
When true, Command Window and Script Editor will not display warning messages.
writeHistory(wh) boolean queryedit
When true, Command Window will echo all of its history to the file defined by the -hf/historyFilename flag. This flag effectively turns file writing on/off.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Set the text of the input area of the Script Editor.
cmds.scriptEditorInfo(input='// select -all; delete;')
# Clear the input area of the Script Editor.
cmds.scriptEditorInfo(input="")

# Begin recording the Script Editor history to a file called
# tempHistoryLog.txt in your maya directory.
cmds.scriptEditorInfo( historyFilename='tempHistoryLog.txt', writeHistory=True )

# Stop recording the Script Editor history
cmds.scriptEditorInfo(writeHistory=False )

# On Windows the following line would print something like "C:/maya/tempHistoryLog.txt"
# On Linux it would be "~/maya/tempHistoryLog.txt"
cmds.scriptEditorInfo(query=True, historyFilename=True)

# Suppress all warning and info messages
cmds.scriptEditorInfo(suppressWarnings=True)
cmds.scriptEditorInfo(suppressInfo=True)