Page 1 of 1

Plugin: Script runner

PostPosted: Fri Feb 24, 2017 5:39 pm
by mus
Hey, here's my first plugin. I actually think it's useful for playing around with the features of docbuilder.

What is does:
When you hit "execute", any script you've entered in the text area gets executed.
It runs in word, spreadsheets and presentations (but the default script example provided is for the Word editor only).

Installing it:
* remove the .zip extension (this board doesnt allow .plugin attachments!?)
* In the desktop editor, just drag& drop it onto the main window. You will then find a plugin icon in the left sidebar.

I'm only getting started on what to do with the scripts, but the possibilities are great!

example code from the documentation:

Code: Select all
// example for a spreadsheet document

var oWorksheet = Api.GetActiveSheet();           // create a new 'oWorksheet' variable and get the created spreadsheet contents
oWorksheet.GetRange("A1").SetValue("Hello World");  // set the 'New cell' value to the A1 spreadsheet cell

// example for a presentation
var oPresentation = Api.GetPresentation();       // create a new 'oPresentation' variable and get the created presentation contents
var oSlide = oPresentation.GetSlideByIndex(0);   // get the first slide
oSlide.RemoveAllObjects();                       // remove all objects from the first slide


So far only tested on Onlyoffice Desktop for Mac.


I welcome your feedback.

Re: Plugin: Script runner

PostPosted: Mon Feb 27, 2017 9:53 am
by Maxim
Hello mus!
It's very good to see your plugin!
We are really glad that you've created your own plugin!
I hope it will be useful for the others.