<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.0.8">
</HEAD>
<BODY>
&nbsp;&nbsp;&nbsp; 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.<BR>
&nbsp;&nbsp;&nbsp; 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.<BR>
&nbsp;&nbsp;&nbsp; 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.<BR>
&nbsp;&nbsp;&nbsp; Any ideas or suggestions how to achieve this?<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Extensionally,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Daniel Abeshouse<BR>
<BR>
<BR>
On Sat, 2003-11-15 at 11:35, Bert Freudenberg wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373"><I>Milan Zimmermann wrote:

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