On Wed, 18 Nov 2009 16:19:45 -0600, Fritz Anderson <fri...@manoverboard.org> said: >It begins to look more and more that I'm out of luck... > >To review, here is the NSLog of the failed core/crel event on 10.5: > >Event = 'core'\'crel'{ 'kocl':'cFld', 'insh':'insl'{ 'kobj':'obj '{ 'want':'cFld', 'from':'null'(), 'form':'indx', 'seld':'abso'($206C6C61$) }, 'kpos':'end ' }, 'prdt':{ 'pnam':'utxt'("Archive") } } > >And here (thanks to Kyle Sluder) is the AEDebugSends printout of the same Scripting Bridge method on 10.6: > >{ 1 } 'aevt': core/crel (i386){ > return id: 7629 (0x1dcd) > transaction id: 0 (0x0) >interaction level: 112 (0x70) > reply required: 1 (0x1) > remote: 0 (0x0) > for recording: 0 (0x0) > reply port: 24083 (0x5e13) >target: > { 2 } 'psn ': 8 bytes { > { 0x0, 0xe20e2 } (Microsoft Entourage) > } >fEventSourcePSN: { 0x0,0x102102 } (xMail Archiver) >optional attributes: > { 1 } 'reco': - 1 items { > key 'subj' - > { -1 } 'null': null descriptor > } > >event data: > { 1 } 'aevt': - 2 items { > key 'kocl' - > { 1 } 'type': 4 bytes { > 'cFld' > } > key 'prdt' - > { 1 } 'reco': - 1 items { > key 'pnam' - > { 1 } 'utxt': 14 bytes { > "Archive" > } > } > } >} > >You see that the event data is much more compact, lacking the insert-here record. If anyone has further advice, I'd be delighted to have it. > >Otherwise, it looks like I'm caught in a crack between AppleScript, 10.5 Scripting Bridge, and Entourage. I may have to fall back to textual scripts (or, Lord help me, chains of AppleEvents and descriptors). It was nice while it lasted (and I should credit 10.6 for the improved handling).
I covered this matter basically on the day that Scripting Bridge first came out (late 2007). http://www.tidbits.com/matt/aserrata.html Scroll down to the notes on p. 508. You'll find information on the problem, along with links to further discussion. Long story short: "make (new)" is incorrectly implemented in Scripting Bridge; it happens to work for certain recent applications (i.e. mostly those written with Cocoa Scripting) but it is by no means canonically correct, and fails with many older, standard scriptable applications such as BBEdit and (as you discovered) Entourage. Thus, the very first command I tried to give using Script Bridge failed miserably. Naturally, I have never tried to give a second command. :) As Hamish says, appscript is far more savvy and flexible about how it structures the Apple events that it translates your code into. Consult my online appscript "book" for further discussion of the vagaries of the "make" command, and how appscript deals with them (geared towards rb-appscript, but the principle is the same): http://www.apeth.com/rbappscript/06commands.html#makeandinsertionlocations See also my AppleScript book, pp 350ff, for a lot more information about how widely the implementation and requirements of "make" can differ from one scriptable application to another. m. -- matt neuburg, phd = m...@tidbits.com, <http://www.tidbits.com/matt/> A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.tidbits.com/matt/default.html#applescriptthings _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com