Nuberudi : you don't have to do it by hand. When you have a string like yours :
584,185|584,185|584,185|584,185|577,185
you can use the method "add new template" with that string. You have nothing to do with
new Template("xxxx", new Array(new Point(91,185),new Point(93,185),new Point(95,185)
because it's javascript code !