How to create a list of projects to jump to
Last updated at 2:06 pm UTC on 20 November 2018
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 case below the property to look for is the existence of a morph on the desktop with a property #isSlideCollection.
The test may be adapted to other needs.
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]
The Transcript window now contains executable code.
You may position the cursor in a line and execute 'do it' to go to that project.