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 protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to