Question for Obsidian users

This Applescript almost does what I want but it doesn't format the results with the proper indentation in my Obsidian Meeting Notes template.

`set motionBy to text returned of (display dialog "Enter 'Motion by':" default answer "")
set descriptionOfMotion to text returned of (display dialog "Enter 'Description of the motion':" default answer "")
set secondedBy to text returned of (display dialog "Enter '2nd by':" default answer "")
set voteResults to text returned of (display dialog "Enter 'Vote Results':" default answer "the vote to approve was unanimous.")

set finalText to "A Motion was made by " & motionBy & " to " & descriptionOfMotion & return & tab & "- 2nd by: " & secondedBy & return & tab & "- " & voteResults

-- Copying the final text to the clipboard
set the clipboard to finalText

-- Displaying the final text in a dialog box
display dialog finalText
`
When pasted into Obsidian, the result looks like this:

But, I want the 2nd and 3rd lines to be indented as shown below. I've tried adding additional tabs but they don't indent to match the result I want.

I would like to duplicate the steps I would use if entering this information manually:

  • I'd start the first line with a hyphen followed by a space followed by the text followed by Return to start a new line.
  • The second line would automatically start with a hyphen at the same indent level as the first. I would enter Tab to indent one level below line 1 followed by my text followed by return to create a third line.
  • The third line would automatically start with a hyphen at the same indent level as the 2nd line.

That's what I'd like to duplicate with this macro but using the variables entered in the script.

It looks as though you are triggering the macro after having entered tab indentation in Obsidian. Any tabs or spaces you have entered to make the presentation look better mean nothing to Obsidian (that is, they no more than any other text), and it will position any following lines where they still logically belong within the note. I think the bottom line is that Obsidian is not meant to be a word processor.

If you still want indentation for aesthetics, you could follow the paste action with Type keystroke actions: Shift-up-arrow twice (to select the text) and then as many tabs as you need. Of course, this will only be suitable if you always want the text to be indented by the same number of tabs.