How to automate changing the background color of a line

Hi, I’m trying to make a small plugin to change the background of selections to green. I did:

(() => {
var action = new PlugIn.Action(function(selection) {
// Add code to run when the action is invoked

return action;


However this gives me the error:

TypeError: Style.set is not a function. (In ‘Style.set(Style.Attribute.BackGroundColor,’, ‘Style.set’ is undefined) /Users/albert/Library/Containers/com.omnigroup.OmniOutliner5.MacAppStore/Data/Library/Application Support/Plug-Ins/Green background.omnijs:15:36

Any guidance much appreciated, thank you.

You might get more traction in the ‘automation’ category…

And failing that, email tech support with your question as otherwise they may not notice your issue.

Thanks! I have opened a follow-up at Changing the background color of a line