Try the fastest and simplest way to install ONLYOFFICE

Plugin: Script runner

Integration questions/issues

Plugin: Script runner

Postby mus » Fri Feb 24, 2017 5:39 pm

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.
Attachments
scriptrunner.plugin.zip
(27.57 KiB) Downloaded 34 times
mus
 
Posts: 30
Joined: Tue Jan 31, 2017 2:52 pm

Re: Plugin: Script runner

Postby Maxim » Mon Feb 27, 2017 9:53 am

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.
Maxim
 
Posts: 1082
Joined: Tue Oct 11, 2016 2:34 pm


Return to Plugins

Who is online

Users browsing this forum: No registered users and 1 guest