Demo package guide
Use four small actions to transform text, write a file, wait, and find matching files.
Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested. See Packages.
Prerequisites
- Nothing to install or sign in to.
- Short file paths start in the Run's working folder. File actions use the permissions of the Device's account.
- Text fields can hold variables, like
Hello $name$. A field that holds only one variable needs a text variable: a Number variable needs a conversion to String first.
Actions
Find files (glob)
List files in a folder that match a pattern, like *.txt.
Inputs
| ID | Field | Type; default; requirement | Use |
|---|---|---|---|
root | root | Stringdefault ""optional | The folder to search, for example samples. Empty: the Run's working folder. A short path starts there. |
pattern | pattern | Stringdefault **/*optional | A pattern like **/*.txt. * matches in one folder level, ** in all subfolders. The default **/* finds all files. |
Outputs
| ID | Type | Result / editor field |
|---|---|---|
files | List | The matching file paths, sorted, from root. Field: files. |
Example
Create samples/a.txt, samples/sub/b.txt and samples/skip.md. Set root=samples and pattern=**/*.txt. Put files in $textFiles$.
Expected result
$textFiles$ is ["a.txt","sub/b.txt"]. The paths start at root and are sorted A to Z. No match gives [].
Sleep (sleep)
Wait a number of milliseconds. Stopping the Run ends the wait.
Inputs
| ID | Field | Type; default; requirement | Use |
|---|---|---|---|
ms | ms | Numberdefault 0optional | Whole milliseconds, for example 250. 0: no wait. -1: wait until the Run stops. Values below -1 fail. |
Outputs
None.
Example
Set ms=250. Put the next step after Sleep.
Expected result
The next step starts after about 250 ms.
Uppercase (upper)
Change text to capital letters, for example before you compare it.
Inputs
| ID | Field | Type; default; requirement | Use |
|---|---|---|---|
text | text | Stringdefault ""required | Text, can hold variables. See Prerequisites. |
Outputs
| ID | Type | Result / editor field |
|---|---|---|
result | String | The text in capitals. Field: result. |
Example
Create String $name$ with value world. Set text=hi $name$. Put result in $greeting$.
Expected result
$greeting$ is HI WORLD. Digits and punctuation stay the same. An empty String variable gives an empty String. An empty text field fails.
Write file (writeFile)
Write text to a file. An existing file is replaced, so test with a file you can lose.
Inputs
| ID | Field | Type; default; requirement | Use |
|---|---|---|---|
path | path | Stringdefault ""required | The file to write, for example samples/. A short path starts in the Run's working folder. The folder must exist. |
text | text | Stringdefault ""optional | Text, can hold variables. See Prerequisites. |
Outputs
None.
Example
Create the samples folder first. Set path=samples/hello.txt and text=hello.
Expected result
samples/hello.txt contains exactly hello, in UTF-8, with no added newline. A missing folder or no write permission fails.