comet.document

The comet.document module provides global document access for the current session, e.g. finding open documents or opening new ones.

See also

Class CDocument

Document object specific functionality

Methods

comet.document.open(path, appendToRecent=True)

Open a document. When the document is already opened it is returned instead.

Parameters
  • path (str) – The full path to the document file

  • appendToRecent (bool) – Should the file be included in the Recent Files menu?

Returns

The newly opened or already open document

Return type

CDocument

Raises
Available

CScript

document::open

comet.document.getFront()

Return the current front document if any, else returns None

Returns

The current front document

Return type

CDocument or None

Available

CScript

document::get_front

comet.document.getOpen()

Fetch a list of all currently open documents

Returns

List of opened documents.

Return type

list[CDocument]

Available

CScript