Programmatically setting markers on the Text Ruler

Hello,

this thread refers to this Where can I find good documentation about the Text Ruler?

To get the result I need - see the reference thread - , I have to use these markers
image
as well as left justified Tabs
image

Marker 1 sets the position of the bullet, Marker 2 sets the position of the indented text. For the indented text to be left align, I also need a left align Tab, which is Marker 3. Marker 3 has to be exactly at the same position of Marker 2.

Working with text ruler is quite complicated, because the Text Ruler is very small and clicking in the wrong place on the ruler adds a new Tab.

My question is: is there a way to programmatically set the position of Marker 1 and Marker 2, and insert a left align Tab ?

If the answer is yes, that would be a wonderful thing because I would be able to add two buttons, one to set the the markers for level 1 of the bullet list and another one to set the markers for level 2 of the bullet list. This way level 1 and level 2 positions would always set to the same place for all text contents.

Thanks

I believe those are properties of your layout object. Consequently, I do not think you can set them via script or in some other calc fashion.

If you are dealing with a font where you know the spacing very well, you may be able to cheat with some invisible characters, but I also believe this would be very brittle and unreliable.

To my knowledge, the only elements you can alter are with conditional formatting, and other settings that rely on some calcs (like the tooltip and placeholder text). Object anchoring also will change the dimension of an object, but that is tied to the window boundaries.

The analogy here is perhaps with html and css: you get to define what you want to show, but the layout object is in charge of how it will show.

If you need something completely custom, turning to the webviewer is likely where you will get most flexibility for things like this.

Since I can't script paragraph formats, I looked for other ways to help user formatting paragraphs the same way. This is done by going Format > Line Spacing > Other...:

image

The center column sets the Indent (Left:) and First Position (First:). The only thing remaining is Tab(s) position. But no need to tap the Tabs... button since the Tabs can be set in the Inspector !

Is there some way I can Open that Dialog from a Button ?

A macro program will be able to do that.

On a Mac (possibly on Windows) you can define app-specific keyboard shortcuts.

System Preferences -> Keyboard -> Shortcuts -> App Shortcuts

Instructions for drilling down into sub-menus is provided by Apple.

Forget to tell it's for a Mac. Is what you call a macro program, an Apple Script ?

When I said macro program I was thinking of something like Keyboard Maestro.

To access a menu, even a sub-sub-menu, you only need to define a shortcut in the System Preferences for Keyboards.

If you wanted to go further, for instance, to press the "Tabs..." button in the dialog that was opened then you would need an AppleScript, or Keyboard Maestro or similar.

Interesting, I will evaluate this.

Thanks

maybe also look into the MBS Hotkey component:

https://www.mbsplugins.eu/HotKeyRegister.shtml