Accessing the Selection

 
 
 

The Selection or Selection object is available from the XSIApplication or XSIApplication object via the XSIApplication.Selection or Application::GetSelection property:

// C++ API
Selection sel( Application.GetSelection() );

// C# 
CXSIApplication app = new CXSIApplication();
Selection sel = app.Selection;
Important

For JScript and VBScript, the XSIApplication object is implicit (meaning it doesn't need to be specified). For Python and Perl, you must use it explicitly:

// JScript -- these versions are both valid
var sel = Selection;
var sel = Application.Selection;

' VBScript -- these versions are both valid
set sel = Selection
set sel = Application.Selection

# Python -- only this syntax may be used
sel = Application.Selection

# Perl -- only this syntax may be used
my $sel = $Application->Selection;