Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

[MBS] Crash in NSAppleScriptMBS (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] [ANN] 12.3pr15
Next thread: [MBS] Blog: Mac OS X 10.8 User Notifications with Filemaker and Real Studio


Re: [MBS] Website Forum Instead of this Newsletter?   -   Garth Hjelte
  [MBS] Crash in NSAppleScriptMBS   -   Beatrix Willius
   Re: [MBS] Crash in NSAppleScriptMBS   -   Christian Schmitz
   Re: [MBS] Crash in NSAppleScriptMBS   -   Beatrix Willius
   Re: [MBS] Crash in NSAppleScriptMBS   -   Christian Schmitz

[MBS] Crash in NSAppleScriptMBS
Date: 29.07.12 14:44 (Sun, 29 Jul 2012 15:44:31 +0200)
From: Beatrix Willius
Hi Christian,

my fun with NSAppleScriptMBS continues:

Thread 9 Crashed:
0 com.apple.applescript 0x14212ec9 ASSetContainerProperty(long, TUASScript*, AEDesc const*, unsigned long) + 204
1 com.apple.applescript 0x14213098 ASSetPropertyLocal(long, unsigned long, AEDesc const*, unsigned long) + 75
2 com.apple.CoreServices.CarbonCore 0x92b6f7a4 callComponent_4444 + 40
3 com.apple.CoreServices.CarbonCore 0x92b60a5d CallComponentFunction + 41
4 com.apple.applescript 0x1420ac4c AppleScriptComponent + 1804
5 com.apple.CoreServices.CarbonCore 0x92adab1e CallComponent + 151
6 com.apple.CoreServices.CarbonCore 0x92adab78 CallComponentDispatch + 29
7 com.apple.openscripting 0x9a39d0fe OSASetProperty + 61
8 MBS Real Studio Cocoa Plugin.rbx_58.dylib 0x0653bdd6 -[NSAppleScript(MBS) setValue_MBS:forProperty:] + 230
9 MBS Real Studio Cocoa Plugin.rbx_58.dylib 0x0653b80f setValueDescriptorForProperty(REALobjectStruct*, REALstringStruct*, REALobjectStruct*) + 207
10 com.mothsoftware.mailarchiverx 0x0038a3c7 NSAppleScriptMBS.setValueDescriptorForProperty%b%o<NSAppleScriptMBS>so<NSAppleEventDescriptorMBS> + 116
11 com.mothsoftware.mailarchiverx 0x007a4fff RunAS.SetParameters%%o<RunAS>o<Dictionary> + 1499
12 com.mothsoftware.mailarchiverx 0x007a7263 RunAS.ExecuteScriptWithParameters%%o<RunAS>o<Dictionary> + 135
13 com.mothsoftware.mailarchiverx 0x00a90461 ExportFilemakerAS.ExportMessage%%o<ExportFilemakerAS> + 2426

The script where this occurs is an old one:

dim theScriptText(-1) as string
theScriptText.Append "property ContentDescription: ''" '1
theScriptText.append "property ContentDisposition: ''" '2
theScriptText.append "property ContentID: ''" '3
'and so on

theScriptText.append "try"
theScriptText.append "set myNewRecord to (create new record with data {OriginatorFrom, OriginatorSender, OriginatorReplyTo, ReceiverTo, ReceiverCc, ReceiverBcc, InternalMessageID, InternalInReplyTo, InternalReferences, InternalReceived, InternalReturnPath, MainDate, MainTime, MainTimeOffSet, MainSubject, MainMailbox, ResentFrom, ResentSender, ResentReplyTo, ResentTo, ResentCc, ResentBcc, ResentDate, ResentMessageID, ResentTime, ResentTimeOffset, OtherStatus, OtherPrecedence, MIMEVersion, ContentType, ContentLength, ContentTransferEncoding, ContentID, ContentDescription, ContentDisposition, ContentLanguage, XMailer, XUIDL, XPriority, XBulkmail, XAttachments, MessageBody, MessageBodyEncoding, HeaderRest, RecID, MessageBodyHtml, ' ', ' ', MainDateTime, ResentDateTime, MailboxID})"
theScriptText.append "on error errMsg number errNr"
theScriptText.append "return 'new records ' & errNr & ', ' & errMsg as string"
theScriptText.append "end try"

Setting the script properties is done with:

Private Sub SetParameters(ScriptParameters as Dictionary)

dim theProperties(-1) as String = theScript.properties
if theProperties = nil or UBound(theProperties) = -1 then Return

for currentProperty as Integer = 0 to UBound(theProperties)
dim PropertyName as String = theProperties(currentProperty)

if ScriptParameters.HasKey(PropertyName) then
dim theValue as String = str(ScriptParameters.Value(PropertyName))
dim theDescriptor as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithString(theValue)
if theScript.setValueDescriptorForProperty(PropertyName, theDescriptor) then
'okay
else
Globals.theErrorLog.LogItem "Error when setting script property: " + PropertyName + " " + theValue
end if
end if
next

End Sub

What can I do to fix this? I push a lot of data through AppleScript here. The autorelease stuff is already in place.

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Crash in NSAppleScriptMBS
Date: 29.07.12 15:55 (Sun, 29 Jul 2012 16:55:45 +0200)
From: Christian Schmitz

Am 29.07.2012 um 16:53 schrieb Beatrix Willius <<email address removed>>:

> I'll try. What do you mean with "edge case"?
>
> Sigh…..

Maybe there is somewhere a fixed limit, an out of bounds exception or an object released too early.
Things that don't show up unless you really do a lot of things with a class.

Greetings
Christian

-

Re: [MBS] Crash in NSAppleScriptMBS
Date: 29.07.12 15:53 (Sun, 29 Jul 2012 16:53:15 +0200)
From: Beatrix Willius
I'll try. What do you mean with "edge case"?

Sigh…..

Am 29.07.2012 um 16:47 schrieb Christian Schmitz:

> Can check this somehow?
>
> Like making a little test project where you get it to crash?
>
> You probably hit some edge case.

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Crash in NSAppleScriptMBS
Date: 29.07.12 15:47 (Sun, 29 Jul 2012 16:47:10 +0200)
From: Christian Schmitz

Am 29.07.2012 um 15:44 schrieb Beatrix Willius <<email address removed>>:

> Hi Christian,
>
> What can I do to fix this? I push a lot of data through AppleScript here. The autorelease stuff is already in place.

Can check this somehow?

Like making a little test project where you get it to crash?

You probably hit some edge case.

Greetings
Christian