Setting row padding via applescript

I would like to be able to use an applescript to set (among other things) the row padding for a document. (I have ~80 outlines which need fixing up thanks to all the formatting changes in OO4.)

When I looked in the OO4 applescript dictionary, I could not find anything that allowed things such as row padding, above note padding, line heights and the like to be set for the document.

Does anyone know how to change these things programmatically?

[ed. note: It is very frustrating to have to spend hours if not days to get carefully laid out documents from one version to look proper (and uniform) in the next version, and to go through all associated Applescripts and fix them for changes in names of properties, etc.]

You can use a variant of the following to set the row padding of a particular level style

set value of attribute "item-row-padding(com.omnigroup.OmniOutliner)" of level style 1 of document "Untitled" to 4

For the line height you can use

attribute "item-row-spacing(com.omnigroup.OmniOutliner)" of level style 1 of document "Untitled"

As far as I know its not possible to discover these attributes without using Late Night Software’s Script Debugger. They do not appear to be listed in the dictionary. Here is a screenshot of the ones that seem to be relevant to you



A very belated “Thank-you”. This was a big help, both because it let me experiment a bit and because it pointed me to better search terms.

The better search terms took me to an older post which allowed listing the attributes.

From that post, I could then finally figure out how to set the document-level attributes. Here it is in case it could be of help to others:

tell application "OmniOutliner"
set destDoc to front document
    set oStyle to style of destDoc
  on error
  end try
  set value of attribute "item-row-padding(com.omnigroup.OmniOutliner)" of oStyle to 2
  set value of attribute "item-to-note-space(com.omnigroup.OmniOutliner)" of oStyle to 1

Thanks again,

P.S. It sure would be nice if this were documented by Omnigroup folks, even in some primitive fashion.

1 Like