How to setup "Open with" Squeak for images (jpeg etc)

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Sat Nov 15 16:35:54 UTC 2003


Milan Zimmermann wrote:

> Hi,
> 
> I'd like to setup my kid's PC (Linux w. KDE) for them to be able to open 
> images with Squeak from the file manager. The idea is that by clicking on a 
> "my-graphics.jpeg" file in the OS File Manager, squeak would start and open 
> the image using the Paint, ideally in a new project. (I guess similarly what 
> "Find + View" would do.)
> 
> I am not asking about how to define the file type association, rather whether 
> it's possible to execute Squeak with a set of options to start Squeak, run 
> Paint and edit the image, I am thinking something like:
> 
> # squeak  image  script-which-opens-paint  my-graphics.jpeg
> 
> Is something like this possible? I guess it would be usefull to have squeak  
> acting as "viewer/editor" for any file types that squeak can handle ..

The script could look like this:

	| stream filename image sketch |
	filename := Smalltalk getSystemAttribute: 3.
	stream := FileStream readOnlyFileNamed: filename.
	[image := Form fromBinaryStream: stream] ensure: [stream close].
	sketch := SketchMorph withForm: image.
	sketch openInWorld

and would be called like this:

squeak /full/path/to/my.image /full/path/to/script.st 
/full/path/to/image.jpeg

-- 
    Bert




More information about the Squeak-dev mailing list