Most tiddler fields are intended to hold a single value that can include spaces. For these fields, you can just use $action-setfield, like this:
<$action-setfield text="this has spaces in it"/>
or
<$action-setfield somefield="one two three"/>
However, the tags field is different. It is expected to contain a LIST of items, where the items are separated by spaces, so
<$action-setfield tags="one two three"/>
adds three separate tags: “one”, “two”, and “three”. If you want to use tag values that contain literal spaces, they have to be enclosed within doubled square brackets, so
<$action-setfield tags="[[one two]] three"/>
adds two tags: “one two”, and “three”
To make it easier to add/remove individual items from the tags field (or any other field that you are using to hold a list of items), there is a different widget, $action-listops, that knows how to do this for you. To add a tag, you can write:
<$action-listops $tags="[[this has spaces]]"/>`
and to remove a tag, you can write:
<$action-listops $tags="-[[this has spaces]]"/>
Note that the $tags=... param is actually using “filter syntax”, and the leading “-” tells $action-listops to REMOVE the specified value from the tags field. So… for your desired use case (adding a tag that contains spaces), you can write:
<$action-listops $tags="[<currentTiddler>addsuffix[ foo]]"/>
Also note that the $tags= param is a special “shorthand” use of the $action-listops widget. The full $action-listops syntax for adding a value to the tags field is:
<$action-listops $field="tags" $subfilter="[<currentTiddler>addsuffix[ foo]]"/>`
which also can be used to add/remove items from any list field you want:
<$action-listops $field="somefield" $subfilter="[<currentTiddler>addsuffix[ foo]]"/>`
Final note: all of the above examples default to setting fields in the current tiddler. To act on a different tiddler you need to add $tiddler="sometiddler" syntax to the widgets:
<$action-setfield $tiddler="sometiddler" tags="one two three"/>
<$action-setfield $tiddler="sometiddler" tags="[[one two]] three"/>
<$action-listops $tiddler="sometiddler" $tags="[[this has spaces]]"/>`
<$action-listops $tiddler="sometiddler" $tags="-[[this has spaces]]"/>
etc...
enjoy,
-e