Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Unclear docs on MacTypes in tk_getOpenFile

Closed / Rejectedfd21a14f5c8a5645c4d79e2aaf09ca8c566b6a7fCreated 2 years agoUpdated 2 years ago
Descriptionmarkdown2025-04-22 12:50:36

The tk_getOpenFile docs seem outdated and unclear about MacTypes.

The docs say

On the Macintosh platform, a file matches a file pattern if its name matches at least one of the extension(s) AND it belongs to at least one of the macType(s) of the file pattern. For example, the C Source Files file pattern in the sample code matches with files that have a -c extension AND belong to the macType TEXT. To use the OR rule instead, you can use two file patterns, one with the extensions only and the other with the macType only. The GIF Files file type in the sample code matches files that EITHER have a -gif extension OR belong to the macType GIFF.

On the Unix and Windows platforms, a file matches a file pattern if its name matches at at least one of the extension(s) of the file pattern. The macTypes are ignored.

I have figured out Macintosh here is not OS X - which is Unix - but OS 9. Which makes the docs obsolete, OS X is 20 years old at this point, and it is using UTIs since around Snow Leopard (around 2006).

I have not figured out what to do on OS X, how to properly call this. It seems the macType is still needed? I have figured out PDFs, for example, used to have four letter code "PDF " (with the space), but I cannot pass that to tk_getOpenFile?

Log in (anonymous is fine) to add a comment.