Crash when running AppleScript

DEVONthink often crashes on my machine when I run a script. Generally I think that the app shouldn’t crash, no matter what the script does. Is this a known issue? There are two references to DEVONthink in the middle of the stack trace.

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	0x00007fff8b864f5e objc_release + 14
1   libobjc.A.dylib               	0x00007fff8b864230 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 464
2   com.apple.CoreFoundation      	0x00007fff91056342 _CFAutoreleasePoolPop + 34
3   com.apple.Foundation          	0x00007fff9625d4fa -[NSAutoreleasePool drain] + 154
4   com.apple.Foundation          	0x00007fff96264fa0 _NSAppleEventManagerGenericHandler + 125
5   com.apple.AE                  	0x00007fff907f4b48 aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) + 307
6   com.apple.AE                  	0x00007fff907f8851 AESendMessage + 1779
7   com.apple.AE                  	0x00007fff9081997b aeSend + 248
8   com.apple.HIToolbox           	0x00007fff9665ea23 AESend + 82
9   com.apple.applescript         	0x0000000122a1dd02 AEDefaultSendProc(AEDesc const*, AEDesc*, int, short, int, unsigned char (*)(EventRecord*, int*, OpaqueRgnHandle**), unsigned char (*)(EventRecord*, int, int, AEDesc const*), void*) + 78
10  com.apple.applescript         	0x0000000122a21323 ComponentSend(AEDesc const*, AEDesc*, int, int) + 510
11  com.apple.applescript         	0x0000000122a2ffcd TUASApplication::Send(TStackFrame_UASRemoteSend*, AEDesc*, AEDesc*, unsigned char, unsigned char, unsigned char) + 2565
12  com.apple.applescript         	0x0000000122a4bee2 UASRemoteSend(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char*) + 432
13  com.apple.applescript         	0x0000000122a57bb9 UASValue_Send(unsigned char, unsigned char, TUASClassIndex, unsigned char) + 178
14  com.apple.applescript         	0x0000000122a344ba UASExecute1() + 369
15  com.apple.applescript         	0x0000000122a3431a UASExecute(unsigned char) + 206
16  com.apple.applescript         	0x0000000122a0a17f ASExecute(unsigned int, unsigned int, int, unsigned int*) + 527
17  com.apple.applescript         	0x0000000122a0633a AppleScriptComponent + 1778
18  com.apple.applescript         	0x0000000122a1d61b AGenericCall::Delegate(ComponentInstanceRecord*) + 37
19  com.apple.applescript         	0x0000000122a1d5e5 AGenericManager::HandleOSACall(ComponentParameters*) + 57
20  com.apple.applescript         	0x0000000122a1cc97 GenericComponent + 255
21  com.apple.openscripting       	0x00007fff952b3c1b OSAExecute + 68
22  com.apple.Foundation          	0x00007fff962db7ff -[NSAppleScript(NSPrivate) _executeWithMode:andReturnError:] + 133
23  com.devon-technologies.thinkpro2	0x0000000100162ba2 0x100000000 + 1452962
24  com.devon-technologies.thinkpro2	0x00000001000b69a8 0x100000000 + 747944
25  com.apple.AppKit              	0x00007fff8dad0a59 -[NSApplication sendAction:to:from:] + 342
26  com.apple.AppKit              	0x00007fff8dc0644c -[NSMenuItem _corePerformAction] + 406
27  com.apple.AppKit              	0x00007fff8dc0613a -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 133
28  com.apple.AppKit              	0x00007fff8d8f346f -[NSMenu _internalPerformActionForItemAtIndex:] + 36
29  com.apple.AppKit              	0x00007fff8d8f32f7 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 135
30  com.apple.AppKit              	0x00007fff8dbff245 NSSLMMenuEventHandler + 342
31  com.apple.HIToolbox           	0x00007fff965dff0a DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1206
32  com.apple.HIToolbox           	0x00007fff965df3d9 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 410
33  com.apple.HIToolbox           	0x00007fff965f51bd SendEventToEventTarget + 40
34  com.apple.HIToolbox           	0x00007fff9662be89 SendHICommandEvent(unsigned int, HICommand const*, unsigned int, unsigned int, unsigned char, void const*, OpaqueEventTargetRef*, OpaqueEventTargetRef*, OpaqueEventRef**) + 443
35  com.apple.HIToolbox           	0x00007fff965d0c11 SendMenuCommandWithContextAndModifiers + 59
36  com.apple.HIToolbox           	0x00007fff965d0bc3 SendMenuItemSelectedEvent + 254
37  com.apple.HIToolbox           	0x00007fff965d0a4f FinishMenuSelection(SelectionData*, MenuResult*, MenuResult*) + 94
38  com.apple.HIToolbox           	0x00007fff965acaab MenuSelectCore(MenuData*, Point, double, unsigned int, OpaqueMenuRef**, unsigned short*) + 605
39  com.apple.HIToolbox           	0x00007fff965ac0b8 _HandleMenuSelection2 + 565
40  com.apple.AppKit              	0x00007fff8dabe9c6 _NSHandleCarbonMenuEvent + 245
41  com.apple.AppKit              	0x00007fff8d9e0b7f _DPSNextEvent + 2073
42  com.apple.AppKit              	0x00007fff8d9dfed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
43  com.apple.AppKit              	0x00007fff8d9d7283 -[NSApplication run] + 517
44  com.apple.AppKit              	0x00007fff8d97bcb6 NSApplicationMain + 869
45  com.devon-technologies.thinkpro2	0x00000001000021f4 0x100000000 + 8692

This is unfortunate. Applescript crashes in DEVONthink are rare. The forum isn’t a good place to diagnose crashes. I suggest you open a ticket directly with Support (here or here or support_at_devontechnologies_dot_com), where you can get faster personalized attention than the forum. Please save relevant console messages, and DEVONthink crash logs (complete logs, not partial snippets), and forward them to Support with your script.

It’s unfortunately an issue caused by Mac OS X’s WebKit framework which is quite unreliable since 10.7.4. However, the next maintenance release (2.4.3) will use a background task for various AppleScript commands and therefore commands like “create web document” shouldn’t crash DEVONthink anymore.

Thanks for the follow-up and great support. In this case I’ll wait for the next version and then publish my improved Pinboard importer script.