Get Started
Plugins
Macros
More information

window.Asc.plugin.executeMethod ("GetSelectionType", callback)

Description

Defines the method that allows getting the type of the current selection.

Usage

This method should be used in the following way:

window.Asc.plugin.executeMethod ("GetSelectionType");
Returns

The method returns the selection type in the string format: "none", "text", "drawing" or "slide".

Example
window.Asc.plugin.executeMethod ("GetSelectionType", [], function(sType) {
    switch (sType) {
        case "none":
        case "drawing":
            window.Asc.plugin.executeMethod ("PasteText", [$("#txt_shower")[0].innerText]);
            break;
        case "text":
            window.Asc.plugin.callCommand (function() {
                Api.ReplaceTextSmart (Asc.scope.arr);
            });
            break;
    }
});