format() and .format() do note work on String data. Strings, Tinderbox’s most basic data type are assumed to be formatted, if only because the output of formatting is normally a string (here, $Text!).
See the modified file be.ow. Select note ‘Container1’ and run stamps ‘String to paragraphs’ and ‘String to paragraphs 2’ on it. the results can be seen in notes ‘Test1’ and ‘Test2’.
I sense there is a question behind this question. IOW, you’re trying to coerce some text into a list to use outside Tinderbox. Knowing the wider context might help.
Meanwhile, in brief, assuming we capture a value in user attribute $ReturnString, then this copies it to the clipboard:
I thought initially it might be simpler to use a string instead of a set. I think of sets when I want to auto de-dupe which in this case I did not need to.
Anyway, I am glad I did not because I learned something today. I did not realize I had a gap in not know .format does not work in a string, only a list or set. In addition, I learned 2 new commands: replace to work on a string and pbcopy to send to the clipboard.
The operator format() converts various Tinderbox objects to strings.
This is why format() or .format() don’t work with a String-type source
.format() works on data types too with Strings and Booleans as the outliers. I presume this is because all non-strings have assumptions you can make about them:
List/Set.format() - also applies to Dictionary if it is treated as if list of key:value list items. you can’t format at the ‘:’ boundary of the latter.