Calling JS macro from JS Filter

I want to call a previously written JS macro from a JS Filter. If I declare:

var relation = require("$:/plugins/cls/mk/getReal");

where getReal tiddler is a JS macro with the function name RelationshipCalc

How do I call it from the JS filter?

In debug mode, I can see relation is loaded:

image

Now, how do I call RelationshipCalc?

I tried:

var relationship = relation.RelationshipCalc(title, operator.operand);

But this results in RelationshipCalc is not a function.

Thanks,

Craig

I asked the question on phind.com and it suggested:

var relationship = relation.run(title, operator.operand);

…which worked. I need to use phind.com more often. Other thoughts/comments?

2 Likes