Hopefully a nice quick one for someone. I\'m working on a project that requires a specific link being written around 400 or so locations. Each link is the same, except it has th
You can do that in Komode.
Just it!
Use a snippet like this named 'ListLink':
<li><a href="/contact-details.html?location=[[%W]]">[[%W]]</a></li>
And create a macro using the scimoz and projects APIs to move the cursor and call the snippet in a loop:
komodo.assertMacroVersion(2);
if (komodo.view && komodo.view.scintilla) { komodo.view.scintilla.focus(); }
var i = 1;
var len = ko.views.manager.currentView.scimoz.lineCount; /* Count lines */
_part = ko.projects.findPart('snippet', 'ListLink', '*'); /* Find Snippet*/
ko.views.manager.currentView.scimoz.documentStart(); /* goto first line */
while (i <= len)
{
if (!_part) {alert("Couldn't find a snippet called 'ListLink' when executing macro."); return;}
ko.projects.invokePart(_part); /* invoke Snippet */
ko.views.manager.currentView.scimoz.lineDown(); /* goto next line */
i++;
}