I want to use two macros in same time.
In case of Korean language, postposition paricle changes with last spell of the word
(similar with An apple, A car)
so I made an Macro that check last word and return appopriate postposition word like,
<<script>>
Macro.add('PPAttach', {
handler: function() {
var len = this.args[0].length-1
var str = (this.args[0].charAt(len) - 0xAC00)%28;
if(str>0)
{str = this.args + "을"}
else{str = this.args + "를"}
$(this.output).wiki(str);
}
});
<</script>>
second, I made random word chage widget like,
<<nobr>>
<<widget "Rword">>
<<set $R1 to either("Apple","Banana","Orange")>>/*sample text insted of Korean Language*/
$R1
<</widget>>
<</nobr>>
and when I use macros in passage like,
<<PPAttach <<Rword>>>>
Script processes like <<PPAttach "<<Rword" >> +">>"
when use like this,
<<PPAttach "<<Rword>>" >>
I suppose that the script processses that ">"is the last word
How can I use random word system, very many type of, with attaching custom macro?
I tried to create random word script and get PPAttach macro in it, but I can't find realistic example but API