How to create a list of projects to jump to
Last updated at 5:30 am UTC on 16 December 2021
The code snippet below shows how a list of projects with a particular property may be compiled.
The list may be used as a 'text based interface' to jump to the projects.
In the use case below projects are selected if they contain a morph on the desktop with the property #isSlideCollection.
The test may be adapted to other needs.
Receipe
1. Open a Workspace
2. Open the Transcript window
3. Add the following code
"Select the projects"
| m |
m := MorphicProject allInstances.
projectsWithPresentations := m select:
[:proj | "test if project meets the criteria"
(proj world submorphs
detect: [:s | s hasProperty: #isSlideCollection] ifNone: [nil]
) notNil ].
"Show the result"
projectsWithPresentations do: [:p | Transcript show: '(Project named: ''', p name, ''') enter'; cr]
Result:
The Transcript window now contains executable code.
You may position the cursor in a line and execute 'do it' to go to that project.