The python API is in the N10X.Editor python module. For example:
N10X.Editor.OpenFile("file.txt")
For example python scripts see %appdata%\10X\PythonScripts\
Execute a 10x command : ExecuteCommand(command_name)
Send an undo event to the currently focused file : Undo()
Send a redo event to the currently focused file : Redo()
Send an key up/down press event to 10x : SendKey(string, (shift, control, alt))
Send an key down event to 10x : SendKeyDown(string, (shift, control, alt))
Send an key up event to 10x : SendKeyUp(string, (shift, control, alt))
Send a char key event to 10x : SendCharKey(string)
Add a function that will be called on the main thread : CallOnMainThread(function)
Shut down 10x - Exit(force)
Control whether 10x writes changes to the state file (for testing only) : SetWriteStateEnabled(bool)
Get the position of the currently focused file in the panel grid : (x, y) GetCurrentPanelGridPos()
Show a message on the status bar : SetStatusBarText(text)
Log a message to the 10x output panel : LogTo10XOutput(string)
Show a message box : ShowMessageBox(string, string)
Show the output panel : ShowOutput()
Clear the 10x output panel : Clear10xOutput()
Make 10x check all open files to see if any of them need to be reloaded : CheckForModifiedFiles()
Select the specified project in the workspace tree : ShowProjectInWorkspaceTree(filename)
Set the cursor colour override : SetCursorColourOverride((r, g, b))
Remove the cursor colour override : ClearCursorColourOverride()
Reset the cursor blink : ResetCursorBlink()
Return true if the find text in file panel is open : bool IsFindPanelOpen()
Return true if the find/replace text in file panel is open : bool IsFindReplacePanelOpen()
Return True if the output panel is open : bool IsOutputPanelOpen()
Return True if the find file panel is open : bool IsFindFilePanelOpen()
Return True if the command panel is open : bool IsCommandPanelOpen()
Return True if the Control key is currently held down: bool ControlKeyHeld()
Return the number of columns in the panel grid : int GetColumnCount()
Set the number of columns in the panel grid : SetColumnCount(int)
Set the text in the command panel : SetCommandPanelText(string)
Set the cursor mode. Valid values: "Line", "Block", "Underscore", "HalfBlock" : SetCursorMode(string)
Reset the cursor mode to the value in the settings file : ResetCursorMode()
Return true if a text editor has focus : bool TextEditorHasFocus()
Execute a command in Visual Studio. For more info see the EnvDTE.ExecuteCommand on MSDN : ExecuteVSCommand(command, args)
Set the main app window size : SetWindowSize(int, int)
Set the currently focused tab : SetFocusedTab(tab_index)
Execute a build command : ExecuteBuildCommand(command, working_dir)
Get the current build config : string GetBuildConfig()
Set the current build config : SetBuildConfig(string)
Get the current build platform : string GetBuildPlatform()
Set the current build platform : SetBuildPlatform(string)
Get the current build config for the active workspace : string GetWorkspaceBuildConfig()
Get the current build platform for the active workspace : string GetWorkspaceBuildPlatform()
Log a message to the build output : LogToBuildOutput(string)
Show the build output panel : ShowBuildOutput()
Clear the build output panel : ClearBuildOutput()
Return True if the build panel is open : bool IsBuildPanelOpen()
Open a file OpenFile(filename)
Close the current file
Save the current file
Save all files : bool SaveAll()
Get the filename of the currently focused file. Empty string if no file focused
Discard unsaved changes for the current file : DiscardUnsavedChanges()
Discard all unsaved changes : DiscardAllUnsavedChanges()
Return true if the current file has been modified : bool IsModified()
Return true if the specified file is read only : bool IsFileReadOnly(filename)
If the file is open give it focus : Focusfile(filename)
Open a workspace : OpenWorkspace(filename)
Close the current workspace : CloseWorkspace()
Add an additional include path to the current workspace : AddWorkspaceAdditionalInclude(path)
Get the current workspace filename : filename GetWorkspaceFilename()
Enable or disable the workspace settings file (used for testing only) : SetWorkspaceSettingsEnabled(bool)
Get all files in the current worksapce : list GetWorkspaceFiles()
Get the project files in the current workspace : list GetWorkspaceProjectFiles()
Get the path to the executable that the workspace builds : string GetWorkspaceExePath()
Return True if the workspace tree is open : bool IsWorkspaceTreeOpen()
Return the path of the local workspace settings path in appdata : string GetAppDataWorkspacePath()
Returns true if the current workspace has finished opening : bool GetWorkspaceOpenComplete()
Return the filename of the currently active project : string GetActiveProject()
Set the current active project. Filename is the full path to the project : SetActiveProject(filename)
Add a force include to the current workspace : AddForceInclude(filename)
Add a breakpoint and return its id : id AddBreakpoint(filename, line_index)
Remove a breakpoint : RemoveBreakpoint(filename, line_index)
Remove a breakpoint : RemoveBreakpointById(id)
Update a breakpoint line : UpdateBreakpoint(id, line_index)
Remove all breakpoints
Get the command to run when starting debugging : string GetDebugCommand()
Get the arguments to pass into the debug command : string GetDebugCommandArgs()
Get the current working directory to use for the debug command : string GetDebugCommandCwd()
Return a list of breakpoints (id, filename, line) : list GetBreakpoints()
return the preprocessed line for the current line : string GetPreprocessedLine()
return the symbol type for the curent symbol : string GetCurrentSymbolType()
Return true if the autocomplete dropdown is currently showing : bool IsSHowingAutocomplete()
Set the parser verbose logging mode : SetParserVerboseLoggingMode(mode)
Return true if autocomplete has completed (even if it's not showing : bool IsAutocompleteComplete()
Temporarily override a setting (doesn't change the settings file) : OverrideSetting(name, value)
Remove a setting override : RemoveSettingOverride(name)
Get the path to the settings folder : filename GetSettingsFolderPath()
Set the name of the settings file to use (for testing only) : SetSettingsFileName(file_name)
Reset all settings to the defaults : ResetSettingsToDefault()
Reset all key mappings to the defaults : ResetKeyMappingsToDefault()
Get the value for the specified setting : string GetSetting(string)
Set the value for the specified setting : SetSetting(string, string)
Get the name of the current key mappings file : string GetKeyMappingsFilename()
Set the name of the key mappings file to use : SetKeyMappingsFilename(filename)
Checkout a file in Perforce : PerforceOpenForEdit(filename)
Push an undo group onto the undo stack : PushUndoGroup()
Pop an undo group from the undo stack : PopUndoGroup()
For code that does lots of text updates wrap it in BeginTextUpdate/EndTextUpdate to make it go fast. It disables much of the internal updating until EndTextUpdate is called : BeginTextUpdate()
For code that does lots of text updates wrap it in BeginTextUpdate/EndTextUpdate to make it go fast. It disables much of the internal updating until EndTextUpdate is called : EndTextUpdate()
Get the entire text for the currently focused file : string GetFileText()
Set the entire text for the currently focused file : SetFileText(text)
Get the line count for the currently focused file : number GetLineCount()
Get the number of lines that are currently visible : number GetVisibleLineCount()
Insert text in the currently focused file at the cursor position : InsertText(text)
Get the cursor position for the currently focused file : (x, y) GetCursorPos()
Set the cursor position for the current focused file : SetCursorPos((x, y))
Get the current selection start position for the currently focused file : (x, y) GetSelectionStart()
Get the current selection end position for the currently focused file : (x, y) GetSelectionEnd()
Set the cursor selection end position for the current focused file : SetCursorPosSelect((x, y))
Get the current line text for the currntly focused file : string GetCurrentLine()
Get the currently selected text : string GetSelection()
Set the cursor selection : SetSelection((start_x, start_y), (end_x, end_y), cursor_index=0)
Get the cursor selection : (x,y), (x,y) GetCursorSelection(cursor_index=0)
Remove the cursor : RemoveCursor(cursor_index)
Show or hide the specified cursor : SetCursorVisible(cursor_index, bool)
Get the line text for the currently focused file : text GetLine(line_index)
Set the line text for the currently focused file : SetLine(line_index, text)
Clears any multi-cursors : ClearMultiCursors()
Clear the current text selection : ClearSelection()
Scroll so that the current line is centered vertically : CenterViewAtLinePos(line_index)
Scroll the cursor so that it is in view : ScrollCursorIntoView()
Get the current scroll line index : GetScrollLine()
Set the current scroll line index : SetScrollLine(line_index)
Add a function that will be called every frame : AddUpdateFunction(function)
Remove an update function : RemoveUpdateFunction(function)
Add a function to be called when a char key is pressed : AddOnCharKeyFunction(function) : function(string)
Add a function to be called before a char key is handled : AddOnInterceptCharKeyFunction(function) : bool function(string)
Remove a function to be called before a char key is handled : RemoveOnInterceptCharKeyFunction(function) : bool function(string)
Add a function to be called when a key is pressed : AddOnKeyFunction(function) : function(string, shift, control, alt)
Add a function to be called before a key press is handled. Return true if handled : AddOnInterceptKeyFunction(function) : bool function(string, shift, control, alt)
Add a function to be called before a key press is handled. Return true if handled : RemoveOnInterceptKeyFunction(function) : bool function(string, shift, control, alt)
Add a function to be called when a read only file is about to be modified : AddOnReadOnlyFileModifiedFunction(function) : function(filename)
Add a function to be called when a workspace is opened : AddOnWorkspaceOpenedFunction(function)
Remove an OnWorkspaceOpenedFunction function : RemoveOnWorkspaceOpenedFunction(function)
Add a function to be called when the settings file has been saved : AddOnSettingsChanged(function)
Add a function that handles commands entered in the command panel. Function takes a string and returns true if command is handled : AddCommandPanelHandlerFunction(function)
Add a function to be called when the parser has finished its main parse : AddParsersFinishedFunction(function)
remove a parser finished function : RemoveParsersFinishedFunction(function)
Add a function to be called when the debugger is started : AddStartDebuggingFunction(function) : bool function() - return True if the debugging process has been overridden
Add a function to be called when the debugger is stopped : AddStopDebuggingFunction(function) : bool function() - return True if the debugging process has been overridden
Add a function to be called when the debugger is Restartped : AddRestartDebuggingFunction(function) : bool function() - return True if the debugging process has been overridden
Add a function to be called when the project is about to be built : AddProjectBuildFunction(function) : bool function(filename) - return True to cancel build
Add a function to be called when a build has finished : AddBuildFinishedFunction(function) : function(build_result)
Add a function to be called before a file is saved : AddPreFileSaveFunction(function) : function(filename)
Add a function to be called after a file has been saved : AddPostFileSaveFunction(function) : function(filename)
Add a function to be called when a breakpoint is added : AddBreakpointAddedFunction(function) where function is function(id, filename, line)
Add a function to be called when a breakpoint is removed : AddBreakpointRemovedFunction(function) where function is function(id, filename, line)
Add a function to be called when a breakpoint is updated : AddBreakpointUpdatedFunction(function) where function is function(id, filename, line)
Add a function to be called when starting to select text with the mouse : AddMouseSelectStartedFunction(function) where function is function((i,i))
Add a function to be called when finishing selecting text with the mouse : AddMouseSelectFinishedFunction(function) where function is function((i,i))
Log to the attached debugger output : DebugLog(string)
Initialise the test environment. Reset settings and disable settings write. Name can be anything : InitialiseTestEnvironment(name)
Enable or disable the parser cache (used for testing only) : SetParserCacheEnabled(bool)
Use a local clipboard instead of the OS clipboard (used for testing only) : SetUseLocalClipboard(bool)
Log UE PCH file paths for this file : SetUEPCHLogFilename(filename)