• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript is now deliberately annoying me to death
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript is now deliberately annoying me to death


  • Subject: Re: AppleScript is now deliberately annoying me to death
  • From: has <email@hidden>
  • Date: Fri, 04 Mar 2016 23:51:44 +0000

Hi again,

Thanks to Stan and Axel for running tests and reporting back, confirming it's not just my imagination (that is, assuming Stan and Axel aren't just figments of my imagination too…:).


On 04/03/2016 22:01, Stan Cleveland wrote:

Is it possible that `Number.unittest.scpt` has an outdated dependency stored in its maintained state? Adding a comment and recompiling would force a fresh copy of the dependency to load and, potentially, put things right.

Nope. Edit the Number.unittest.scpt script again to remove the comment you put in, and the failure comes back. It's the shape of the script that determines whether or not the problem occurs, and the fact that even adding a comment makes it go away again

My best guess would be an obscure bug between the bytecode serializer/deserializer (which converts live bytecode to/from .scpt data) and OSACompile() when using kOSAModeAugmentContext that sometimes produces subtly malformed bytecode that causes the interpreter to puke in odd ways when it tries to interpret it. Augmenting the unittest script's context is the only "unusual" thing osatest does compared to other apps that load and execute AS scripts, so I think it has to be related to that, otherwise we'd be seeing similar problems in everyday use. (I don't like doing code generation in non-Lispy languages, but compiling a custom __performunittest__ handler into the unittest script was the easiest way to prepare and run each test given all of AS's other shortcomings.) The fact that one of the "nonsense" errors is dsMixedModeFailure (1011) may also be a bit of a clue, given the AS interpreter has hopped across multiple architectures over the years (I think that one dates back to the 68K->PPC transition) while maintaining bytecode compatibility. But eh, speculation only points to where the problem might be, not fixes it.

I suppose with sufficient work I could redesign the test framework to avoid doing anything that might set it off, but I don't want to muck up its UI/UX and in any case I'm out of time so just want to get these libraries tested, debugged, and off my hands ASAP. Given that the behavior is replicable, I can work around it for now when it appears just by fiddling unittest files till it goes away again. Should Apple be persuaded to take these libraries (cold day in hell, I know), getting to the bottom of it will be their problem. (Or whoever else I finally dump them on.)

...

BTW, if you or anyone else has some spare hours in the next week or so, I could use a hand assembing documentation. The Date, Number, and Text libraries need self-contained documentation for their date formatting, number formatting, and regular _expression_ syntaxes respectively. Not an exciting job: it basically means trawling through Apple's Data Formatting Guide and NSRegularExpression docs, and the Unicode consortium and ICU pages that those link to, pulling out the relevant bits of information, amending it for AS as necessary, and assembling it into a plain HTML file that can be embedded in the libraries and linked to by their SDEFs. But it needs done, and it's a self-contained task so can be done without having to spend time learning or working on the libraries themselves.


Oh, and thanks for flagging up a bunch of fresh problems with the Date commands. (Dates and times are a giant PITA at the best of times.) Obviously I need to extend the current test script to run through all time zones automatically. Still, slowly getting there.

Cheers,

has
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >AppleScript is now deliberately annoying me to death (From: has <email@hidden>)

  • Prev by Date: Re: Applescript count mail attachment error
  • Next by Date: Insert page in Preview
  • Previous by thread: Re: AppleScript is now deliberately annoying me to death
  • Next by thread: increment a variable
  • Index(es):
    • Date
    • Thread