In the meanwhile, automatically quoted insert from REPL test is:
editor
.selection
.startItem
.setAttribute(
'data-search',
editor.itemPathFilter
);
- Get your filter right in search panel
- Type a label for it in the editor, and place the cursor after it
- Run the lines above from a script assigned to a shortcut
(The parentheses get quoted automatically)
Type a search label and place the cursor in the label line
Run this script from a hotkey
Get a @search tag with automatic quoting of parentheses
Source:
function run() {
// TASKPAPER CONTEXT
function TaskPaperContext(editor, options) {
editor
.selection
.startItem
.setAttribute(
'data-search',
editor.itemPathFilter
);
}
// JAVASCRIPT FOR AUTOMATION CONTEXT
var ds = Application('com.hogbaysoftware.TaskPaper3')
.documents;
if (ds.length) {
return ds[0].evaluate({
script: TaskPaperContext.toString(),
withOptions: {}
});
}
}