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

squeak at oafamily.com squeak at oafamily.com
Sun Nov 16 19:08:34 UTC 2003


    I haven't had too much call for such functionality yet, but it seems
to me it would be a useful tool for the OS to be able to send messages
to a running image. For example when a user double clicks an icon,
follows a link in a (gasp) non scamper browser and squeak acts as a
helper application (here is where my interest lies), or executes
something from a command line.
    It would probably have to be platform specific, and might require a
helper app, perhaps based on the VM, that just runs long enough to get
the info over to squeak or start it up if it's not running (I think
that's how emacs does it). I'm also not sure how it would handle
multiple images already running.
    Having written this, I'm sure someone will now point out that it is
already easily achieved, but I have not spotted the solution it my,
admittedly cursory, search.
    Any ideas or suggestions how to achieve this?

        Extensionally,
        Daniel Abeshouse


On Sat, 2003-11-15 at 11:35, Bert Freudenberg wrote:

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20031116/4081de84/attachment.htm


More information about the Squeak-dev mailing list