pymel.core.windows.scriptEditorInfo

static windows.scriptEditorInfo(*args, **kwargs)

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.

Flags:
Long name (short name) Argument Types Properties
clearHistory (ch) bool ../../../_images/edit.gif
 
Clears the read-only text in the upper field of the Command Window.
clearHistoryFile (chf) bool ../../../_images/edit.gif
 

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) unicode ../../../_images/query.gif ../../../_images/edit.gif
 

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) unicode ../../../_images/edit.gif
 

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) bool ../../../_images/query.gif ../../../_images/edit.gif
 
When true, Command Window and Script Editor will not display error messages.
suppressInfo (si) bool ../../../_images/query.gif ../../../_images/edit.gif
 
When true, Command Window and Script Editor will not display info messages generated by Maya.
suppressResults (sr) bool ../../../_images/query.gif ../../../_images/edit.gif
 
When true, Command Window and Script Editor will not display command results.
suppressStackWindow (ssw) bool ../../../_images/query.gif ../../../_images/edit.gif
 

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. Flag can have multiple arguments, passed either as a tuple or a list.

suppressWarnings (sw) bool ../../../_images/query.gif ../../../_images/edit.gif
 
When true, Command Window and Script Editor will not display warning messages.
writeHistory (wh) bool ../../../_images/query.gif ../../../_images/edit.gif
 
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.

Derived from mel command maya.cmds.scriptEditorInfo

Example:

import pymel.core as pm

# Set the text of the input area of the Script Editor.
pm.scriptEditorInfo(input='// select -all; delete;')
# Result: u'CommandWindow' #
# Clear the input area of the Script Editor.
pm.scriptEditorInfo(input="")
# Result: u'CommandWindow' #

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

# Stop recording the Script Editor history
pm.scriptEditorInfo(writeHistory=False )
# Result: u'CommandWindow' #

# On Windows the following line would print something like "C:/maya/tempHistoryLog.txt"
# On Linux it would be "~/maya/tempHistoryLog.txt"
pm.scriptEditorInfo(query=True, historyFilename=True)
# Result: u'/Users/chad/Library/Preferences/Autodesk/maya/tempHistoryLog.txt' #

# Suppress all warning and info messages
pm.scriptEditorInfo(suppressWarnings=True)
# Result: u'CommandWindow' #
pm.scriptEditorInfo(suppressInfo=True)
# Result: u'CommandWindow' #

Previous topic

pymel.core.windows.scmh

Next topic

pymel.core.windows.scriptTable

Core

Core Modules

Other Modules

This Page