Some caveats, I’m using ST3, I’m reasonably sure there’s no difference in ‘macro language’ between ST3 & 4.
I’m also reasonably sure there isn’t a loop function in macro language so you’ll have to
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
95 times before you insert your code, if you start at the top of the file, but I’m getting ahead of myself.
The ‘macro code’ below moves to the top of the file, then moves down 10 lines (not 95) and then inserts some minus signs and a new line.
It might be easier to record parts of your snippet using the macro record function and then save it and then copy and paste that code into a larger bespoke macro.
As for a macro that inserts a snippet, I’m not sure but here’s a previous post on the subject which has links to some useful info concerning snippets and macros.
Macro to move to beginning of file, move down 10 lines and insert some minus signs
[
{
"args":
{
"extend": false,
"to": "bof"
},
"command": "move_to"
},
{
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
},
{
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
},
{
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
},
{
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
},
{
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
},
{
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
},
{
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
},
{
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
},
{
"args":
{
"by": "lines",
"forward": true
},
"command": "move"
},
{
"args":
{
"extend": false,
"to": "eol"
},
"command": "move_to"
},
{
"args":
{
"characters": "\n"
},
"command": "insert"
},
{
"args":
{
"extend": false,
"to": "bol"
},
"command": "move_to"
},
{
"args":
{
"characters": "-----------------------------------"
},
"command": "insert"
},
{
"args":
{
"characters": "\n"
},
"command": "insert"
}
]
I appreciate this isn’t an answer to your question, but might be enough to get you started and might help to get this post answered with a better answer than mine…

