Hello,
I am again probably misunderstanding something but I can't see what.
I have the following code in a tiddler to select a day of week and create a new tiddler out of it.
\define maketitle() $(year)$ $(week)$ $(selectedday)$
\define getnumber() <$view tiddler="dayNumber" index=$(selectedday)$ \>
!Add to the Weekly Record schedule for week <<now WW>>
Select a day :
<$select tiddler="$:/_ppmt/temp/selectday" default=<<now DDD>> >
<option>Monday</option>
<option>Tuesday</option>
<option>Wednesday</option>
<option>Thursday</option>
<option>Friday</option>
<option>Saturday</option>
<option>Sunday</option>
</$select>
<$set name="week" value=<<now WW>> >
<$set name="year" value=<<now YYYY>> >
<$set name="selectedday" value={{$:/_ppmt/temp/selectday!!text}}>
<$set name="boo" value=<<getnumber>> >
In the tiddler it works <<boo>> but if I click on the button to create a new day then it crashes
<$maketid title=<<maketitle>> tags="dailywork" template="$:/_ppmt/template/Daily_Records" edit="yes">
<$iftid tiddler=<<maketitle>> then="tm-edit-tiddler" else="tw-new-tiddler">
<$button message="tw-if-tiddler">
Create / Edit Selected day
</$button>
</$iftid>
</$maketid>
</$set></$set></$set></$set>
The macro getnumber() is reading from a dictionnary tiddler that map the day of the week to a numbe from 1 to 7.
the value week, year, selectedday and boo are used in a template to populate some field. All was working well until I introduced the variable boo to the template. At this point I get the following error
Internal JavaScript Error
Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser
SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line 1 column 750 of the JSON data
What confuses me is that the macro is working since I can use it in the tiddler above and it display the correct number but in the templates it fails :(
Philippe