AlJohri / docx2pdf

MIT License
497 stars 94 forks source link

Word Crashes during Conversion #97

Open boggleboggle opened 7 months ago

boggleboggle commented 7 months ago

I am trying to convert files on an Apple Silicon Mac running Sonoma 14.2 After a few files are converted (2-10), Word crashes and the script fails.

It looks like there might be a case mismatch between "Document" and "document", but I know nothing about Objective-C.

The Word error file is below:

Microsoft Error Reporting log version: 2.0

Error Signature: Exception: EXC_BAD_INSTRUCTION ExceptionEnumString: 2 Exception Code: 0x00000001 (0x0000000000000000) Date/Time: 2023-12-15 13:09:48 +0000 Application Name: Microsoft Word Application Bundle ID: com.microsoft.Word Application Signature: MSWD Application Bitness: x64 Application Version: 16.80.0.23121017 Crashed Module Name: merp Crashed Module Version: 16.80.23121017 Crashed Module Offset: 0x0000000000011d08 Blame Module Name: unknown Blame Module Version: 16.80.0.231210 UnsymbolicatedChecksum: FC4B1108D1829404392B45D1C1A2681B Blame Module Offset: unknown StackHash: 43556adc90b71736_2_main_arm Application LCID: 1033 Extra app info: Reg=en Loc=0x0409 Build Type: Release Crashed thread Stack Pointer: 0x_000000016cfc6f60 Crashed thread: 0 uncaught ObjC exception, reason: Error while creating a script command: there's no Objective-C class 'Document' corresponding to the .sdef-declared type 'document'.

Last Exception Backtrace: 0 CoreFoundation 0x0000000183134570 __exceptionPreprocess + 176 1 merp 0x00000001081760bc MerpHandleNSException + 1024 2 libobjc.A.dylib 0x0000000182c25eb4 objc_exception_throw + 60 3 Foundation 0x00000001849157bc -[NSAppleEventDescriptor(NSScriptConversion) _valueOfType:withDeferredSpecifierEvaluation:] + 0 4 Foundation 0x000000018491584c -[NSAppleEventDescriptor(NSScriptConversion) _valueOfType:withDeferredSpecifierEvaluation:] + 144 5 Foundation 0x000000018491a544 +[NSScriptCommand(NSInternal) _getReceiversSpecifierOrUnnamedArgument:fromEvent:usingDescription:] + 128 6 Foundation 0x000000018491a970 +[NSScriptCommand(NSInternal) _commandFromEvent:] + 184 7 Foundation 0x000000018492a648 -[NSScriptingAppleEventHandler handleCommandEvent:withReplyEvent:] + 76 8 Foundation 0x000000018419e414 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 316 9 Foundation 0x000000018419e208 _NSAppleEventManagerGenericHandler + 80 10 Foundation 0x0000000184867be8 _NSAppleEventManagerPreDispatchHandler + 412 11 AE 0x000000018a014dc0 _AppleEventsCheckInAppWithBlock + 13808 12 AE 0x000000018a0146e8 _AppleEventsCheckInAppWithBlock + 12056 13 AE 0x000000018a00dcf8 aeProcessAppleEvent + 488 14 HIToolbox 0x000000018d67c2d4 AEProcessAppleEvent + 68 15 AppKit 0x000000018689abb0 _DPSNextEvent + 1440 16 AppKit 0x0000000187074980 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716 17 AppKit 0x000000018688dd50 -[NSApplication run] + 476 18 AppKit 0x0000000186865014 NSApplicationMain + 880 19 dyld 0x0000000182c610e0 start + 2360

================

Omitted some thread details

================

OS Information Operating System: Mac OS X 14.2 (Build 23C64) CPU: ARM64e, Logical CPU Count: 16 Physical Memory: 65536 MB Device_model: Mac15,9 Screen: 2560.000000 x 1440.000000, bitsPerPixel = 24, frame = 0.000000, 0.000000, 2560.000000, 1440.000000 CrashedApp_Virtual_Memory_Size_MB: 406956.000000 CrashedApp_Resident_Memory_Size_MB: 516.000000 CrashedApp_Memory_Footprint_MB: 796.000000 ErrorReportingDeviceUUID: 1C373354-4C0F-58A9-B1FE-D0C8192FEE3C ErrorReportingUUID: DE6385D2-03E4-4EA8-B4A8-7E65CE53E757 ULS UUID: 9E60588E-4D02-496E-B770-2FA87BDBFD6F CrashedLogSessionId: 9E60588E-4D02-496E-B770-2FA87BDBFD6F TimeFromLaunch: 0 hours, 3 minutes, 51 seconds CrashedSessionDuration: 231 Total errors on this client: 11

Microsoft Application Information: Audience: Production SHSuffixKey_0: _arm AudienceChannel: CC AudienceGroup: Production

Nikotine1 commented 6 months ago

Same issue here! On a MacBook Pro M2 with macOS 14.2.1.

This is the error in Word. When I click on details, I get the same error as @boggleboggle. word

I also notice the docx document gets opened twice. This is the error you get in python cli: python

Afterwards I'm left with an extra temporary docx file: files

Nikotine1 commented 6 months ago

I found that the script probably couldn't write to the folder because I had to log in again into Onedrive. After I had done that, it worked again.

simmermanChad commented 4 months ago

I'm also still getting this issue. The only way around it I've found is if I've already manually created the PDFs and running the scripts updates them. Any news on this?

Error Message: Microsoft Error Reporting log version: 2.0

Error Signature: Exception: EXC_BAD_INSTRUCTION ExceptionEnumString: 2 Exception Code: 0x00000001 (0x0000000000000000) Date/Time: 2024-03-18 17:48:28 +0000 Application Name: Microsoft Word Application Bundle ID: com.microsoft.Word Application Signature: MSWD Application Bitness: x64 Application Version: 16.83.0.24031120 Crashed Module Name: merp Crashed Module Version: 16.83.24031120 Crashed Module Offset: 0x000000000000e004 Blame Module Name: unknown Blame Module Version: 16.83.0.240311 UnsymbolicatedChecksum: 0D2384BF14310F48E6F2782EA7C353E1 Blame Module Offset: unknown StackHash: 3fcf5c5ed9cec28a_2_main_arm Application LCID: 1033 Extra app info: Reg=en Loc=0x0409 Build Type: Release Crashed thread Stack Pointer: 0x_000000016fbfebe0 Crashed thread: 0 uncaught ObjC exception, reason: Error while creating a script command: there's no Objective-C class 'Document' corresponding to the .sdef-declared type 'document'.

Machine: iMac M1 - 2021 macOS 14.4

yan-barta commented 2 months ago

For me worked closing Word before running the script. It was crashing only if Word was already opened when my script was run.