Download
Get text-lines.js from the repository.
Complete block reference (3 blocks)
TurboWarp extension guide
Count lines, read one line, or copy every line into a Scratch list with three focused blocks.
Quick start
Text Lines writes directly to Scratch lists, so it must run without the extension sandbox.
Get text-lines.js from the repository.
In TurboWarp Desktop, open Extensions, choose Custom Extension, then load the downloaded file.
Enable Run extension without sandbox when TurboWarp asks for permission.
How it works
Text Lines separates the input wherever it finds a line ending, then uses the resulting lines in the block you choose.
Apple Banana Cherry
Block reference
Returns how many lines the input contains.
Returns the line at the requested position.
Splits the input and writes each line as one list item.
Details
LF (\n), CRLF (\r\n), and CR (\r) are all treated as a single line ending.
The selected list is updated as soon as the command block runs, and list monitors refresh automatically.
All 3 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.
number of lines in [TEXT]Returns the number of lines in the supplied text.
Block type: REPORTER. Opcode: lineCount. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
TEXT | STRING | first line
second line |
line [LINE] of [TEXT]Returns one line using a one-based line number. Invalid line numbers return an empty string.
Block type: REPORTER. Opcode: lineAt. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
TEXT | STRING | first line
second line | |
LINE | NUMBER | 1 |
put lines of [TEXT] into list [LIST]Replaces the contents of the named Scratch list with the lines of the supplied text.
Block type: COMMAND. Opcode: writeLinesToList. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
TEXT | STRING | first line
second line | |
LIST | STRING | Not specified |
対応GUIの固定入力機能は既定OFFです。既存値は開いただけでは変更せず、reporter接続は評価・置換しません。新しい選択と有限JSON数値入力のみを検証して保存し、既存の補正・丸め処理を維持します。機能OFFで従来の編集へ戻せます。