Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
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.

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.