Bug 96725 - CONFIGURATION: "Open With > LibreOffice" missing for AppleWorks (.cwk) files on Mac
Summary: CONFIGURATION: "Open With > LibreOffice" missing for AppleWorks (.cwk) files ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
4.3.7.2 release
Hardware: x86 (IA32) macOS (All)
: medium normal
Assignee: Markus Keller
URL:
Whiteboard: target:7.1.0 target:7.0.0.1 target:7.0.2
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-25 23:08 UTC by Markus Keller
Modified: 2021-12-25 23:06 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Right-click CWK file (259.93 KB, image/png)
2016-03-23 12:36 UTC, isaacaweiss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller 2015-12-25 23:08:57 UTC
The "Open With > ..." context menu in the Mac OS X Finder is missing "LibreOffice" for legacy AppleWorks documents. The converter works very well when I drop a file on the LibreOffice.app. But sometimes, the context menu is just more convenient.

I'm on an old Mac and can't use the latest LibreOffice to verify if this is still an issue, but http://cgit.freedesktop.org/libreoffice/core/tree/sysui/desktop/macosx/Info.plist.in looks like AppleWorks is still missing.

I've fixed the issue in my install by adding this to my LibreOffice.app/Contents/Info.plist:

		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>cwk</string>
				<string>*</string>
			</array>
			<key>CFBundleTypeName</key>
			<string>AppleWorks Document</string>
			<key>CFBundleTypeOSTypes</key>
			<array>
				<string>CWWP</string>
				<string>CWSS</string>
				<string>CWDB</string>
				<string>CWGR</string>
				<string>CWPT</string>
				<string>CWPR</string>
			</array>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
		</dict>

(After that, you need to rename/move the LibreOffice.app around to get the Finder to replace its caches, or maybe also restart the Finder.)

Apple Works documents of the latest versions often have a .cwk extension, but older documents can only be identified by their legacy Creator/Type information.

I don't know whether LibreOffice really supports all 6 file types. CWWP, CWSS, and CWGR are definitely supported. I took the whole set from here: https://code.google.com/p/understand/wiki/AppleWorks

If you know more about the Info.plist format, you may also want to add this one:
> Common Mac OS X UTI: com.apple.appleworks.document
Comment 1 Markus Keller 2015-12-25 23:29:44 UTC
I should have said where I added that section: It was at the end of this array:

	<!-- Document type declaration for OS X < 10.4 -->
	<key>CFBundleDocumentTypes</key>
	<array>
Comment 2 MM 2015-12-26 12:12:07 UTC
LO v5 should have some more support for appleworks over v4, as seen here: https://wiki.documentfoundation.org/Feature_Comparison:_LibreOffice_-_Microsoft_Office
Comment 3 Buovjaga 2015-12-27 17:40:44 UTC
Hmm.. I guess you could submit a patch for Info.plist.
Patch submission is complicated by you having an older system..

If the gerrit patch review application used by LibreOffice would be updated to a newer version, it would be possible to *directly* edit the file: https://gerrit-review.googlesource.com/Documentation/user-inline-edit.html

Luckily a version bump is on the radar: https://redmine.documentfoundation.org/issues/1587
Comment 4 Alex Thurgood 2015-12-28 08:23:34 UTC
Hmm, this works for me on

Version: 5.0.3.2
Build ID: e5f16313668ac592c1bfb310f4390624e3dbfb75
Locale : fr-FR (fr.UTF-8)

OSX 10.11.2

No repro
Comment 5 Alex Thurgood 2015-12-28 08:27:28 UTC
I downloaded the collection of CWK files from :

http://wirelust.com/examples/archiving/appleworks/

right mouse button clicked on one of them, chose Information (Properties), chose "Other" from the list of apps, then selected LibreOffice from the Applications folder, then closed the Information window.

Double-click on a cwk opens it in LibreOffice.

I would close this as WFM
Comment 6 Buovjaga 2015-12-28 10:13:54 UTC
4.3.x is end of life, so let's close this as WFM.

Markus: if you can try with a newer Mac and LibreOffice 5 and still see the problem, you can set this back to UNCONFIRMED.
Comment 7 Markus Keller 2016-01-07 15:30:47 UTC
Reproduced comment 0 in 5.0.4 as well.

CCing Andras, who recently made changes to the Info.plist.in and probably knows best how to properly add AppleWorks document types.

Comment 5 lists some workarounds, but the Open With > ... menu should work out of the box, and it should also work if you have more than one application that can open AppleWorks files (e.g. Pages can open AppleWorks 6 text documents).
Comment 8 isaacaweiss 2016-03-23 12:36:49 UTC
Created attachment 123790 [details]
Right-click CWK file

I don't see the problem with LO 5.1.0.3 on El Capitan—see attached screenshot.
Comment 9 Alex Thurgood 2016-06-13 15:17:30 UTC
WFM

Version: 5.3.0.0.alpha0+
Build ID: 4d49c9601c9b3e26a336e08e057d299895683480
Threads CPU : 2; Version de l'OS :Mac OS X 10.11.5; UI Render : par défaut; 
Locale : fr-FR (fr.UTF-8)
Comment 10 Markus Keller 2020-05-01 16:31:59 UTC
I've submitted a Gerrit for this change:
https://gerrit.libreoffice.org/c/core/+/93139

I have to manually apply this fix each time my father updates his LibreOffice.app, last time for LibreOffice 6.4.3.

I'm not familiar with all the dark magic that decides what appears in the "Open With >" menu and what doesn't, depending on other apps you have installed, etc.

On his machine, LibreOffice does not appear in the menu without this fix. Could be because he also has two versions of Apple's Pages.app installed, which claim to be able to open AppleWorks documents, but usually fail miserably, especially for documents that have been created with older versions of ClarisWorks.
Comment 11 Buovjaga 2020-05-01 16:36:03 UTC
(In reply to Markus Keller from comment #10)
> I've submitted a Gerrit for this change:
> https://gerrit.libreoffice.org/c/core/+/93139

Thanks. See this for sending a license statement:
https://wiki.documentfoundation.org/Development/GetInvolved#License_statement
Comment 12 Markus Keller 2020-05-01 18:07:09 UTC
(In reply to Alex Thurgood from comment #5)
(In reply to isaacaweiss from comment #8)
I guess you could manually convince macOS to open *.cwk with LibreOffice, but
- this should work out of the box
- it should also work for files that lack any extension, but instead have the legacy TYPE/CREA from Classic Mac OS

(In reply to Buovjaga from comment #11)
Done: https://lists.freedesktop.org/archives/libreoffice/2020-May/085011.html
Comment 13 eisa01 2020-05-10 20:47:45 UTC
Thanks for the patch!

I was looking at other icon bugs and had a look at your patch.

I don't think you should specify * as an Document Extension, as that will make LO open any file if I understand the documentation correctly?

Other than that, the properties you use are deprecated in preference for “Document Content Type UTIs”, but will probably work

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-101685-TPXREF107
Comment 14 Commit Notification 2020-06-01 07:14:05 UTC
Markus Keller committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4baa2f1e48969acf64139624cebc4929909d4906

tdf#96725 Register AppleWorks document types in Info.plist

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Markus Keller 2020-06-08 22:02:02 UTC
Sorry for the long delays, I only sporadically have access to a Mac to test this.

Thanks for applying the patch. I've verified the fix with LibreOfficeDev_7.1.0.0.alpha0_MacOS_x86-64.dmg from 2020-06-08_05.15.57.

I've also tested without the <string>*</string>, and the CFBundleTypeOSTypes still matched, so I would be OK with removing that line.


I also had a look at UTIs, but found Apple's documentation to be incomplete. If you think we need to go with them, here's my proposal (worked for me as well):

- Add at then end of the
			<key>LSItemContentTypes</key>
			<array>
section:
				<string>com.apple.appleworks.document</string>


- Add at the very end of the Info.plist in the
	<key>UTImportedTypeDeclarations</key>
	<array>
section:

		<dict>
			<key>UTTypeIdentifier</key>
			<string>com.apple.appleworks.document</string>
			<key>UTTypeDescription</key>
			<string>AppleWorks Document</string>
			<key>UTTypeConformsTo</key>
			<array>
				<string>public.data</string>
			</array>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>com.apple.ostype</key>
				<array>
					<string>CWWP</string>
					<string>CWSS</string>
					<string>CWDB</string>
					<string>CWGR</string>
					<string>CWPT</string>
					<string>CWPR</string>
				</array>
				<key>public.filename-extension</key>
				<array>
					<string>cwk</string>
				</array>
			</dict>
		</dict>
Comment 16 Buovjaga 2020-06-09 07:22:39 UTC
Markus: do you want to do a follow-up patch or will you close this as resolved fixed?
Comment 17 Commit Notification 2020-06-16 07:21:47 UTC
Markus Keller committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/707bd46798c0c17e227d4c1daa229e7f259bb9e5

tdf#96725 Register AppleWorks document types in Info.plist

It will be available in 7.0.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2020-09-08 20:43:15 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/02d431279c59a4be8e2d01d5605a3c5e41666b01

tdf#96725: Add LSHandlerRank for the recently added AppleWorks Document

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2020-09-16 13:37:46 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/12fc7bd71e39dfab94485e9404dc0b24b699e23f

tdf#96725: Add LSHandlerRank for the recently added AppleWorks Document

It will be available in 7.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Xisco Faulí 2021-02-09 14:03:53 UTC
Hello Markus Keller, Tor Lillqvist,
Is this bug fixed? if so, could you please close it as RESOLVED FIXED ?
Otherwise, Could you please explain what's missing?
Thanks
Comment 21 eisa01 2021-12-25 23:06:09 UTC
This has been fixed