The Scripts menu
by Little Outliner Tuesday, January 17, 2017

This post describes new features in Little Outliner v1.65c. The first post about this feature was on Scripting News. You should read it before diving in here. 

Verb set

The verb set is implemented in this JavaScript file. You should only call functions defined in this file if you want compatibility across versions of the app. 

File verbs

A couple of users, coming from Fargo, were happy to see the Scripts menu appear in LO2, but were hoping to see the file verbs that were in Fargo. After a little thought I was able to create versions of the file verbs but instead of writing to Dropbox, they write to the storage system for LO2. The two systems work differently in small ways.

A file can be either public or private. All files that you write in LO2 from a script are public. Files that you read can be either private or public.

There's a new verb, file.getFileList, that gets a list of all the files you have on the server. It takes one param, a function that is called-back when the list is available. The list is an array of strings containing paths of files that can be passed to file.readWholeFile, for example. 

file.getFileList (function (theList) {

      dialog.alert ("There are " + theList.length + " files in the list.");

      });

Menus are hierarchic

To make a command a hierarchic menu instead of a script, add an attribute flSubMenu with the value true.

Demo scripts

I've made the OPML file for my Scripts menu public. 

Here's an instant outline version of the same file. 

Questions? Post a comment below.