Regarding TestOSAPlugin & Applescript

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Regarding TestOSAPlugin & Applescript

Ken G. Brown

I did some digging into TestOSAPlugin.
It looks to me that some late AppleScript support is available from SqueakMap as Applscript, and that the latest changeset is here:
<http://www.squeaksource.com/Applescript.html>
<http://www.squeaksource.com/Applescript>

Andrew Greenberg is the original author. Javier Díaz Reinoso is the name on the Squeaksource project. I have not yet located the TestOSAPlugin source code. Anyone have it?
See emails from archives far below.

And it might be a good idea to perhaps take TestOSAPlugin out of the picture in VMMaker since Applescript is a better name. This may have impact on 'AppleScript Media Player Interface' on SqueakMap which appears to require TestOSAPlugin, as does the Applescript changeset on SqueakMap.

. Javier Díaz Reinoso said on Nov 2 2005,

>I put an update for Applescript that works in 3.8 in squeaksource:
>
>>  http://kilana.unibe.ch:8888/Applescript.html
>
>this version is not full compatible with the unicode changes in 3.8
>or AppleScript 1.10 for Mac OS X 10.4, for that further changes are
>needed, also a new plugin.
>
>Be aware that scripts who use the line continuation character 0xC2
>(194) can have problems in 3.8, that is because reading the file
>convert this character to 0xAC (macToSqueak).

When attempting to load Applescript from SqueakMap into a squeak-dev-118.image running on Squeak 3.8.17beta5U.app, an error saying 'invalid utf8 input detected' occurs:


6 May 2007 2:18:52 pm

VM: Mac OS - a SmalltalkImage
Image: Squeak3.9 [latest update: #7067]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /mySqueakStuff/Sqkb/Sqkb3.10a/squeak-dev-118VMfresh
Trusted Dir /foobar/tooBar/forSqueak/bogus
Untrusted Dir /Users/kbrownMPro/Library/Preferences/Squeak/Internet/My Squeak

UTF8TextConverter(Object)>>error:
        Receiver: an UTF8TextConverter
        Arguments and temporary variables:
                aString: 'Invalid utf8 input detected'
        Receiver's instance variables:
                acceptingEncodings: nil
                currentCharSize: 1
                forceToEncodingTag: nil

UTF8TextConverter>>errorMalformedInput
        Receiver: an UTF8TextConverter
        Arguments and temporary variables:

        Receiver's instance variables:
                acceptingEncodings: nil
                currentCharSize: 1
                forceToEncodingTag: nil

UTF8TextConverter>>nextFromStream:
        Receiver: an UTF8TextConverter
        Arguments and temporary variables:
                aStream: MultiByteFileStream: '/mySqueakStuff/Sqkb/Sqkb3.10a/squeak-dev-118VMfr...etc...
                character1: $ª
                value1: 170
                character2: Character space
                value2: 32
                unicode: nil
                character3: $D
                value3: 68
                character4: nil
                value4: nil
        Receiver's instance variables:
                acceptingEncodings: nil
                currentCharSize: 1
                forceToEncodingTag: nil

MultiByteFileStream>>next
        Receiver: MultiByteFileStream: '/mySqueakStuff/Sqkb/Sqkb3.10a/squeak-dev-118VMfresh/sm/cache/package...etc...
        Arguments and temporary variables:
                char: nil
                secondChar: nil
                state: nil
        Receiver's instance variables:



--- The full stack ---
UTF8TextConverter(Object)>>error:
UTF8TextConverter>>errorMalformedInput
UTF8TextConverter>>nextFromStream:
MultiByteFileStream>>next
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MultiByteFileStream(PositionableStream)>>nextChunk
MultiByteFileStream(PositionableStream)>>nextChunkText
ClassCategoryReader>>scanFrom:
[] in MultiByteFileStream(PositionableStream)>>fileInAnnouncing: {[val := (self peekFor: $!)     ifTrue: [(Compiler evaluate: self nextChunk l...]}
BlockContext>>on:do:
[] in MultiByteFileStream(PositionableStream)>>fileInAnnouncing: {[:bar |  [self atEnd]   whileFalse: [bar value: self position.    self skipS...]}
[] in ProgressInitiationException>>defaultMorphicAction {[result := workBlock value: progress]}
BlockContext>>ensure:
ProgressInitiationException>>defaultMorphicAction
ProgressInitiationException>>defaultAction
UndefinedObject>>handleSignal:
MethodContext(ContextPart)>>handleSignal:
MethodContext(ContextPart)>>handleSignal:
ProgressInitiationException(Exception)>>signal
ProgressInitiationException>>display:at:from:to:during:
ProgressInitiationException class>>display:at:from:to:during:
ByteString(String)>>displayProgressAt:from:to:during:
MultiByteFileStream(PositionableStream)>>fileInAnnouncing:
[] in SMDefaultInstaller(SMSimpleInstaller)>>fileIntoChangeSetNamed:fromStream: {[global newChanges: changeSet.  stream fileInAnnouncing: 'Loading ' , newNam...]}
BlockContext>>ensure:
SMDefaultInstaller(SMSimpleInstaller)>>fileIntoChangeSetNamed:fromStream:
SMDefaultInstaller>>fileIn
SMDefaultInstaller>>install
[] in SMLoader>>installPackageRelease: {[(SMInstaller forPackageRelease: aRelease) install.  myRelease = self instal...]}
BlockContext>>ensure:
CursorWithMask(Cursor)>>showWhile:
[] in SMLoader>>installPackageRelease: {[Cursor wait   showWhile: [(SMInstaller forPackageRelease: aRelease) install...]}
BlockContext>>on:do:
SMLoader>>installPackageRelease:
SMLoader>>installPackageRelease
SMLoader>>perform:orSendTo:
[] in MenuItemMorph>>invokeWithEvent: {[(selArgCount := selector numArgs) = 0   ifTrue: [target perform: selector] ...]}
BlockContext>>ensure:
CursorWithMask(Cursor)>>showWhile:
MenuItemMorph>>invokeWithEvent:
MenuItemMorph>>mouseUp:
MenuItemMorph>>handleMouseUp:
MouseButtonEvent>>sentTo:
MenuItemMorph(Morph)>>handleEvent:
MorphicEventDispatcher>>dispatchDefault:with:
MorphicEventDispatcher>>dispatchEvent:with:
MenuItemMorph(Morph)>>processEvent:using:
MorphicEventDispatcher>>dispatchDefault:with:
MorphicEventDispatcher>>dispatchEvent:with:
MenuMorph(Morph)>>processEvent:using:
MenuMorph(Morph)>>processEvent:
MenuMorph>>handleFocusEvent:
[] in HandMorph>>sendFocusEvent:to:clear: {[ActiveHand := self.  ActiveEvent := anEvent.  result := focusHolder     han...]}
[] in PasteUpMorph>>becomeActiveDuring: {[aBlock value]}
...etc...


Ken G. Brown

Search for AppleScript in the archives:
<http://aspn.activestate.com/ASPN/search?query=AppleScript&x=0&y=0&type=Archive_squeak-list_list>

<http://aspn.activestate.com/ASPN/Mail/Message/squeak-list/3197225>

>squeak-list
>[ANN]Applescript-jdr.6.mcz
>by Javier Diaz-Reinoso other posts by this author
>Jul 16 2006 11:22AM messages near this date
>
> Correction about Applescript-jdr.6.mcz | Apicall and cdecl
>Updated in squeaksource (tested in 3.8, MacOSX 10.4.7):
>
>Add patches from Bert Freudenberg:
>- do not create Applescript generic instance on non-Mac
>- removed references to TestOSAPlugin
>- ignore errors on startup
>
>Also:
>- if AEDesc> >createFromText: receive a WideString, create a
>typeUnicodeText ('ut16') instead of a typeText ('TEXT'), see the
>sample dialogWithUTF16.
>- sample loadTIFF: use unix names, to work with the latest Mac VM.
>
>

<http://aspn.activestate.com/ASPN/Mail/Message/squeak-list/2881850>

>squeak-list
>[ANN] Applescript for 3.8
>by Javier Diaz-Reinoso other posts by this author
>Nov 2 2005 11:43AM messages near this date
>
> Smalltalk Solutions 2006 | RFD - Envy-like MC repository
>I put an update for Applescript that works in 3.8 in squeaksource:
>
>>  http://kilana.unibe.ch:8888/Applescript.html
>
>this version is not full compatible with the unicode changes in 3.8
>or AppleScript 1.10 for Mac OS X 10.4, for that further changes are
>needed, also a new plugin.
>
>Be aware that scripts who use the line continuation character 0xC2
>(194) can have problems in 3.8, that is because reading the file
>convert this character to 0xAC (macToSqueak).
>So this don't work:
>
>Applescript doIt: 'beep ¬
>3'
>
>this work:
>
>Applescript doIt: ('beep ¬
>3' squeakToMac)
>
>or:
>
>cl := (Character value: 194) asString.
>Applescript doIt: 'beep ', cl, '
>3'

<http://aspn.activestate.com/ASPN/Mail/Message/squeak-list/2081524>

>squeak-list
>Re: Applescript code needs a home
>by Javier Diaz-Reinoso other posts by this author
>May 21 2004 7:02PM messages near this date
>
> Applescript code needs a home | Re: Applescript code needs a home
>I can support that, but I have a question: because that Applescript
>stuff needs the Applescript plug-in and that is provided by John M
>McIntosh with the VM, is not better to include the .cs with the
>plug-in?
>
>In any case I use this code in my proyects and I can support it.
>
>On 20/05/2004, at 23:06, Tim Rowledge wrote:
>
>>  I failed a long time ago to find a home for the Applescript code that
>>  Andy Greenberg wrote and which came out of the image as part of the
>>  removal of the VMMaker code. There doesn't seem to be anything on SM
>>  that holds it.
>>
>>  Who would like to care for it? It ought to be someone with decent
>>  knowledge of Apple stuff. I certainly can't do anything useful with it.
>>  I _do_ have a file with what I think is most of it for anyone
>>  interested.
>>
>>  tim
>>  --
>>  Tim Rowledge, tim@[...].edu, http://sumeru.stanford.edu/tim
>>  "Bother" said Pooh, as his trigger finger tired.
>>
>>
>Javier Diaz-Reinoso
>Web: http://homepage.mac.com/javier_diaz_r/
Reply | Threaded
Open this post in threaded view
|

Re: Regarding TestOSAPlugin & Applescript

johnmci

The TestOSAPlugin in the Mac OS tree has all the source code. The  
SLANG plugin code generated I believe is *all* the source code, there  
is no other C code.

On May 6, 2007, at 1:48 PM, Ken G. Brown wrote:

>
> I did some digging into TestOSAPlugin.
> It looks to me that some late AppleScript support is available from  
> SqueakMap as Applscript, and that the latest changeset is here:
> <http://www.squeaksource.com/Applescript.html>
> <http://www.squeaksource.com/Applescript>
>
> Andrew Greenberg is the original author. Javier Díaz Reinoso is the  
> name on the Squeaksource project. I have not yet located the  
> TestOSAPlugin source code. Anyone have it?
> See emails from archives far below.
>
> And it might be a good idea to perhaps take TestOSAPlugin out of  
> the picture in VMMaker since Applescript is a better name. This may  
> have impact on 'AppleScript Media Player Interface' on SqueakMap  
> which appears to require TestOSAPlugin, as does the Applescript  
> changeset on SqueakMap.

--
========================================================================
===
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===


Reply | Threaded
Open this post in threaded view
|

Re: Regarding TestOSAPlugin & Applescript

Ken G. Brown

Ok, thought maybe that was the case.

On a slightly related topic, do you think it would be worthwhile going though the plugins and make the names more consistent with the convention? I'm not sure exactly all that is involved but perhaps some cleanup would improve things for the future?

I was rooting around everywhere learning where things happened and it being the first time through, I was initially confused by the following:

internal plugin B3DEnginePlugin generated as Squeak3D
internal plugin BalloonEnginePlugin generated as B2DPlugin
internal plugin BitBltSimulation generated as BitBltPlugin
internal plugin DSAPlugin generated as DSAPrims
internal plugin DeflatePlugin generated as ZipPlugin
internal plugin FFIPlugin generated as SqueakFFIPrims
internal plugin KlattSynthesizerPlugin generated as Klatt
internal plugin LargeIntegersPlugin generated as LargeIntegers

The rest seem to have matching names and folders everywhere.

Thx,
Ken


>The TestOSAPlugin in the Mac OS tree has all the source code. The SLANG plugin code generated I believe is *all* the source code, there is no other C code.
>
>On May 6, 2007, at 1:48 PM, Ken G. Brown wrote:
>
>>
>>I did some digging into TestOSAPlugin.
>>It looks to me that some late AppleScript support is available from SqueakMap as Applscript, and that the latest changeset is here:
>><http://www.squeaksource.com/Applescript.html>
>><http://www.squeaksource.com/Applescript>
>>
>>Andrew Greenberg is the original author. Javier Díaz Reinoso is the name on the Squeaksource project. I have not yet located the TestOSAPlugin source code. Anyone have it?
>>See emails from archives far below.
>>
>>And it might be a good idea to perhaps take TestOSAPlugin out of the picture in VMMaker since Applescript is a better name. This may have impact on 'AppleScript Media Player Interface' on SqueakMap which appears to require TestOSAPlugin, as does the Applescript changeset on SqueakMap.
>
>--
>===========================================================================
>John M. McIntosh <[hidden email]>
>Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
>===========================================================================

Reply | Threaded
Open this post in threaded view
|

Re: Regarding TestOSAPlugin & Applescript

timrowledge
 

On 6-May-07, at 4:54 PM, Ken G. Brown wrote:

>
> On a slightly related topic, do you think it would be worthwhile  
> going though the plugins and make the names more consistent with  
> the convention? I'm not sure exactly all that is involved but  
> perhaps some cleanup would improve things for the future?

We considered doing this several years ago - probably when I first  
wrote VMMaker - but it would mean changing quite a few methods in the  
image and breaking backward compatability, so we decided against it.  
I do think it would be a good idea at some point but that whole  
'making a new image with loads of stuff changed and to hell with back-
compat' meme seems to make people scream in terror.

>
> I was rooting around everywhere learning where things happened and  
> it being the first time through, I was initially confused by the  
> following:
>
> internal plugin B3DEnginePlugin generated as Squeak3D
> internal plugin BalloonEnginePlugin generated as B2DPlugin
> internal plugin BitBltSimulation generated as BitBltPlugin
> internal plugin DSAPlugin generated as DSAPrims
> internal plugin DeflatePlugin generated as ZipPlugin
> internal plugin FFIPlugin generated as SqueakFFIPrims
> internal plugin KlattSynthesizerPlugin generated as Klatt
> internal plugin LargeIntegersPlugin generated as LargeIntegers
>
> The rest seem to have matching names and folders everywhere.
You'll find the name defaults to the same as the implementation  
class's name unless overridden by (I think) #pluginName. Best  
compromise we could come up with at the time.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: FA: Failsafe Armed


Reply | Threaded
Open this post in threaded view
|

Re: Regarding TestOSAPlugin & Applescript

Ken G. Brown
 
I see, can understand the naming issues. Maybe at some opportune time when back compatibility is broken anyway.

I don't want to get into a big discussion, but I'm just expressing an opinion here. It seems to me that back compatibility is most often a big anchor on moving forward. Those that want/need back compatibility are always free to stay in the past with whatever version they last had. In the long term, if compromises are always made in the direction of back compatibility, I think that the overall quality of the system is of course, 'compromised'.

Similarly, if decisions are always made in the direction of 'the simplest thing that could possibly work', in the long run you end up with bunch of stuff that perhaps only 'simply' works. This 'simplest thing' idea is great for prototyping or testing out ideas, but one needs to always remember to go back and clean up after.

Perhaps a better rule of thumb is 'doing the best thing in the best possible way'. The semantics can be argued forever tho.

And since I seem to be on a roll here, if you always buy cheap tools, in the long run you end up surrounded with a bunch of cheap junk that when you really need to get a job done, the tool either breaks or does a crappy job.

And if you always patch things instead of repairing properly, pretty soon you are surrounded with patched stuff everywhere, all on the verge of failure.

Yeah, yeah, I know, need to define 'repair properly', 'best thing', 'best possible way', etc.
 
Maybe I should reconsider clicking send here! :)

Ken

>On 6-May-07, at 4:54 PM, Ken G. Brown wrote:
>
>>
>>On a slightly related topic, do you think it would be worthwhile going though the plugins and make the names more consistent with the convention? I'm not sure exactly all that is involved but perhaps some cleanup would improve things for the future?
>
>We considered doing this several years ago - probably when I first wrote VMMaker - but it would mean changing quite a few methods in the image and breaking backward compatability, so we decided against it. I do think it would be a good idea at some point but that whole 'making a new image with loads of stuff changed and to hell with back-compat' meme seems to make people scream in terror.
>
>>
>>I was rooting around everywhere learning where things happened and it being the first time through, I was initially confused by the following:
>>
>>internal plugin B3DEnginePlugin generated as Squeak3D
>>internal plugin BalloonEnginePlugin generated as B2DPlugin
>>internal plugin BitBltSimulation generated as BitBltPlugin
>>internal plugin DSAPlugin generated as DSAPrims
>>internal plugin DeflatePlugin generated as ZipPlugin
>>internal plugin FFIPlugin generated as SqueakFFIPrims
>>internal plugin KlattSynthesizerPlugin generated as Klatt
>>internal plugin LargeIntegersPlugin generated as LargeIntegers
>>
>>The rest seem to have matching names and folders everywhere.
>You'll find the name defaults to the same as the implementation class's name unless overridden by (I think) #pluginName. Best compromise we could come up with at the time.
>
>
>tim
>--
>tim Rowledge; [hidden email]; http://www.rowledge.org/tim
>Strange OpCodes: FA: Failsafe Armed