Applescript error?

Ben Rubinstein benr_mc at cogapp.com
Fri Dec 17 10:04:41 EST 2004


> New to Revolution.  May be a convert from HyperCard :-)

Come on in, the water's lovely.  I am a deep, deep, HyperCard loyalist;
"Bill Atkinson is my hero" t-shirt worn to shreds; will always bleed in one
colour, etc.  Revolution is unquestionable the onlie true descendant;
incorporating just about everything that was good about HyperCard, with some
really fantastic advances.  I used RealBasic for a few years, and there are
some nice things about that product, but overall I find Revolution
infinitely better.  We're still dealing with IDE issues, but getting there;
the engine is very solid; and most importantly the development team is
excellent. 

> 1) I have a button in my HyperCard stack -with a Hypertalk script-
> which has as its content a small applescript. So "do me as
> applescript" in the Hypertalk script executes. Where is the best place
> to put this snippet of applescript in my Rev Stack? Or, even better
> than compiling it again everytime, is there a better way to do this?

No alternative to compiling it again everytime - ie Rev, like HyperCard,
simply supports the 'do x as applescript' construction.  Best place to put
it?  Every object in Rev - stack, card, group, field, button, etc - can have
unlimited custom properties.  So no need to store this sort of thing in the
script anymore (effectively the only custom property available in HC).  So
put the applescript into a custom property called eg "uAppleScript", and
then eg "do the uAppleScript of me as applescript".

> 2) A question too about overhead. This is a small stack I want to run,
> basically one card that requests to a network and an applescript to
> send stuff to iCal. If I buy Dreamcard, I need to run it to access the
> stack. Upgrading to the Studio edition will allow me to build
> standalones... and it will just be stuff I'm running on this Mac,
> perhaps three or so stacks concurrently, OSX dual USB iBook. What is
> going to be the best use of Memory?

Note sure it makes much odds; if you can make it work with Dreamcard Player,
you should be able to use that to run your stacks without the memory
overhead of the IDE.

> 3) :-) I have had Rev quit a couple of times developing this little
> stack, as Rev pages in and out of RAM, I think. Maybe it's the calls
> to the applescript, which seem to launch HyperCard in Classic. So I
> need to get that applescript up to where I can deal with it.

Hmpph.  I use AppleScript from Rev quite a bit, never does me any harm.  Not
necessarily communicating with Classic apps, though I'd have said I do
sometimes.

If you can make it reproducible - and even if you can't, but can give a good
description of the setup - please report this in Bugzilla:
<http://support.runrev.com/bugdatabase/>.  On OS X, there should be crash
logs, which you'll find in ~/Library/Logs/CrashReporter/Revolution.crash.log
- you can attach these to your report, which is helpful.

> 4) And the 'request from server' gives me back a -1701 error , which
> is an AppleEvent thing, I think.

"errAEDescNotFound", apparently.  Whatever that means.

> 5) and I forget because I was interrupted by my daughter... hmmmm....
> you can't help me with that :-)

Nope, try eBay.

> Oh! MIDI! I have another stack which I would like to work on which depends on
> an xcmd (XCMD?) which does a call to Quicktime to export out a MIDI file.
> Anyone working on this kind of stuff?

I know nothing about MIDI.

But one to thing watch re XCMDs; Rev implements the original (or strictly
speaking, I think, the 1.1) XCMD API; but not the subsequent enhancements
(most of which came in with HC 2, IIRC).  In theory, XCMDs could be written
so that they tested if a particular function was available; but as far as I
know, few if any ever did.  If an XCMD makes an unsupported call, Rev does
the right thing in terms of supplying a polite response, but many (most?)
XCMDs don't check it properly, and crash.  If you have access to the source
code of the XCMD, you can very likely code round the missing calls (I found
a bunch of mine were just using some convenience functions like StrToRect,
which it weren't in the earlier API (and blush, of course I wasn't
checking), so it was trivial to replace these calls).

So first point, save before you test XCMDs, you might crash; secondly, test
them hard!

Good luck, have fun.
 
  Ben Rubinstein               |  Email: benr_mc at cogapp.com
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com        |  Fax  : +44 (0)1273-728866



More information about the use-livecode mailing list