Open a Workspace with content
Last updated at 9:47 am UTC on 30 October 2018
To programmatically open a workspace with some text already in it, execute this Squeak code:
StringHolder
new textContents: ('Hello World!! This is a test.')
withSqueakLineEndings;
openLabel: 'Workspace test'
| st ws |
st := WriteStream on: String new.
0 to: 30 do: [:i | st nextPutAll: (Date today addDays: i) printString.
st nextPutAll: ': '.
st cr].
ws := Workspace new.
ws contents: st contents.
ws openLabel: 'Next 31 days'.

To include the weekday
| st ws |
st := WriteStream on: String new.
0 to: 30 do: [:i | | d |
d := Date today addDays: i.
st nextPutAll: d dayOfWeekName.
st nextPutAll: ', '.
st nextPutAll: d printString.
st nextPutAll: ': '.
st cr].
ws := Workspace new.
ws contents: st contents.
ws openLabel: 'Next 31 days'.
Open a Workspace with text content
See also
List the content of all workspaces of all projects in an image.