I want to add the first letter of the page title as label to that page, using PowerScripts for Confluence.
The script I have is file setFirstCharacterPageTitleAsLabel with code:
number pageId = id;
string newLabel = substring(pageId.title,0,1);
addLabels(pageId, newLabel);
return
"id: " + pageId,
"title: " + pageId.title,
"label: " + newLabel;
On the page I put the 'Sil script' macro as follows:

But as you can see I immediately get an error. What am I doing wrong?