Missing "TYPE" code...

31 views
Skip to first unread message

Scott in Pollock

unread,
May 8, 2019, 6:50:16 AM5/8/19
to BBEdit Talk
Hi there…

I am not sure just when this started, but in 12.6.3 (under a fresh install of Hi-C Error) I am seeing that Type & Creator codes are not being set in newly created documents. This has the unfortunate side effect of documents without a file extension (such as clippings created via the Clippings menu) opening by default in TextEdit.

Did this change or is something else awry on my end? 

Rich Siegel

unread,
May 8, 2019, 7:01:24 AM5/8/19
to bbe...@googlegroups.com
On 5/7/19 at 2:18 AM, scottin...@gmail.com (Scott in
Pollock) wrote:

>I am not sure just when this started, but in 12.6.3 (under a
>fresh install of Hi-C Error) I am seeing that Type & Creator
>codes are not being set in newly created documents.

BBEdit doesn't set HFS file type/creator anymore. (I don't
remember when I made this change.)

R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they
sedate me.

Scott in Pollock

unread,
May 8, 2019, 5:53:39 PM5/8/19
to BBEdit Talk
On Wednesday, May 8, 2019 at 4:01:24 AM UTC-7, Rich Siegel wrote:
BBEdit doesn't set HFS file type/creator anymore. (I don't
remember when I made this change.)

 Bummer. I know it is pre-OS Xish, but the masses revolted when Apple attempted to discontinue support for it. Why would you yank it from BBEdit?

Patrick Woolsey

unread,
May 8, 2019, 5:58:03 PM5/8/19
to bbe...@googlegroups.com
On 5/8/19 at 5:43 PM, scottin...@gmail.com (Scott in Pollock) wrote:

> On Wednesday, May 8, 2019 at 4:01:24 AM UTC-7, Rich Siegel wrote:
> >
> > BBEdit doesn't set HFS file type/creator anymore. (I don't
> > remember when I made this change.)
>
>
> Bummer. I know it is pre-OS Xish, but the masses revolted when Apple
> attempted to discontinue support for it.

Not exactly, but that's a matter for Mac history forums, not here. :-)

> Why would you yank it from BBEdit?

Because the OS hasn't supported them for many years.


Regards,

Patrick Woolsey
==
Bare Bones Software, Inc. <https://www.barebones.com/>

Patrick Woolsey

unread,
May 8, 2019, 6:02:21 PM5/8/19
to bbe...@googlegroups.com
On 5/8/19 at 5:58 PM, pwoo...@barebones.com (Patrick Woolsey) wrote:

>On 5/8/19 at 5:43 PM, scottin...@gmail.com (Scott in Pollock) wrote:
>>
>>Why would you yank [type/creator codes] from BBEdit?
>
>Because the OS hasn't supported them for many years.


I should perhaps also note that we made the relevant change in
BBEdit quite some time ago.

Scott in Pollock

unread,
May 9, 2019, 8:55:17 AM5/9/19
to BBEdit Talk
On Wednesday, May 8, 2019 at 2:58:03 PM UTC-7, Patrick Woolsey wrote:
Because the OS hasn't supported them for many years.


Not to be argumentative, but to be clear… the OS still supports it (always has). This includes the Finder and Nav Services. Just because a file extension takes precedence doesn't mean it isn't supported. The Info.plist key is:

 <key>CFBundleTypeOSTypes</key>
 
<array>
   
<string>TEXT</string>
 
</array>

Rich Siegel

unread,
May 9, 2019, 9:16:52 AM5/9/19
to bbe...@googlegroups.com
On 5/9/19 at 4:36 AM, scottin...@gmail.com (Scott in
Pollock) wrote:

>Not to be argumentative, but to be clear… the OS still
>supports it (always has).

No, you're obviously being argumentative. :-)

There are various places in which the OS *allows* the
specification and description of four-character type and creator
codes in various places. This does not mean that they are *supported*.

The legacy file system APIs which explicitly supported HFS file
type and creator still work for the moment, but are deprecated.
Their replacements (which BBEdit 12.5 and later are using)
explicitly do *not* include support for the legacy HFS type and
creator codes.

Moreover, the HFS *creator* code would have mattered once upon a
time, but the OS launch services (which is what the Finder uses
to decide which application opens a given file) ignore the HFS
creator code.

It's not subject to interpretation or appeal.

It's time to forget about HFS type and creator, thank them for
their service, and move on.

To solve your problem: if you want to make new clippings that
will open in BBEdit when you double-click them in the Finder,
give them a ".txt" extension.

Or you can use one of the other mechanisms available to open
clippings without leaving BBEdit: use the Edit button in the
Clippings palette, or hold down the Option key while choosing a
clipping from the menu (which is working again in 12.6.4, betas
of which have been posted on this list).

There are many aspects of the old ways which were arguably
better than the current ways; but I find that railing against
the march of progress is generally better at producing carbon
dioxide than it is at producing results. :-)

Sam Hathaway

unread,
May 9, 2019, 11:12:52 AM5/9/19
to bbe...@googlegroups.com

On 9 May 2019, at 9:16, Rich Siegel wrote:

To solve your problem: if you want to make new clippings that will open in BBEdit when you double-click them in the Finder, give them a ".txt" extension.

Another possible solution: BBEdit ships with a Service called “Open File in BBEdit”. You can set a keybinding for it in the Keyboard prefpane (I use ⌘⌥B) and use that to open any file in BBEdit, regardless of file extension or other metadata.

But also: I’ve managed to make “bare” files (no extension or other metadata) open in BBEdit with a double-click. For example, I just used touch ~/Desktop/bare_file in the Terminal to create such a file, and then double-clicked it in the Finder; BBEdit opened.

Such files have a Uniform Type Identifier of public.data, and using a utility like RCDefaultApp you can set the default application for that UTI. (I’ve found that this can sometimes succeed where using “Change All…” in the Get Info window fails.)

Hope this helps!
-sam

Scott in Pollock

unread,
May 9, 2019, 11:55:48 AM5/9/19
to BBEdit Talk
On Thursday, May 9, 2019 at 6:16:52 AM UTC-7, Rich Siegel wrote:
The legacy file system APIs which explicitly supported HFS file
type and creator still work for the moment, but are deprecated.

 LOL... Ok, maybe "supported" was the wrong word. "Still works" was probably more appropriate.

On Thursday, May 9, 2019 at 8:12:52 AM UTC-7, Sam Hathaway wrote:

Another possible solution: … Hope this helps!


Oddly enough, the CFBundleTypeOSTypes key istill remains in BBEdit's Info.plist, they are just not writing the attribute to newly created files. But if the file does have the attribute, it will open in BBEdit. Easily set with one line of AppleScript:

tell application "Finder" to set file type of ((POSIX file "/Users/ss/Desktop/test") as alias) to "TEXT" 


Thanks,

-SiP

@lbutlr

unread,
May 9, 2019, 12:11:21 PM5/9/19
to BBEdit Talk
On 9 May 2019, at 09:12, Sam Hathaway <list....@munkynet.org> wrote:
> Another possible solution: BBEdit ships with a Service called “Open File in BBEdit”. You can set a keybinding for it in the Keyboard prefpane (I use ⌘⌥B) and use that to open any file in BBEdit, regardless of file extension or other metadata.

This is what I do, though I haven't bothered to set a key combination for it. IO *would* like it if BBEdit showed up in the Mojave Preview pane actions but I suppose I can just make a service in automator?

Erm.. and Action in Automator. I'm never going to get uso that.


--
Instant karma's going to get you!


Scott in Pollock

unread,
May 9, 2019, 12:59:46 PM5/9/19
to BBEdit Talk


On Thursday, May 9, 2019 at 9:11:21 AM UTC-7, @lbutlr wrote:
Erm.. and Action in Automator. I'm never going to get uso that.


Speaking of Automator... I just created this folder action and assign it to my clippings folders. Issued solved (and "Automated" thanks to Sal... too bad Apple let him go).

Screen Shot 2019-05-09 at 9.53.01 AM.png

 

@lbutlr

unread,
May 9, 2019, 1:50:29 PM5/9/19
to BBEdit Talk
On 9 May 2019, at 10:11, @lbutlr <kre...@kreme.com> wrote:
> I suppose I can just make a service in automator?

This is what I ended up with as an Automator Action:

<https://www.dropbox.com/s/0gapa4nqqw6wbex/Screenshot%202019-05-09%2010.31.15.png?dl=0>
<https://www.dropbox.com/s/tcmqs4ec6qb5cbe/Screenshot%202019-05-09%2011.44.05.png?dl=0>

The issue so far is that .mkv files (and some others like ppt) show up as documents I can open in BBEdit, even if I add a condition "File extension is not mkv" or "File extension is not .mkv" ¯\_(ツ)_/¯


--
Hey, baby, I've got just the cure for that penis envy back at my
apartment...


@lbutlr

unread,
May 9, 2019, 2:12:51 PM5/9/19
to BBEdit Talk
On 9 May 2019, at 10:58, Scott in Pollock <scottin...@gmail.com> wrote:
> I just created this folder action and assign it to my clippings folders. Issued solved (and "Automated" thanks to Sal... too bad Apple let him go).
>
> <Screen Shot 2019-05-09 at 9.53.01 AM.png>

This will change the modification date for every clipping file in the folder, pretty sure.

Something like

tell app "Finder"
if file type of (file theFile as alias) is not "TEXT" then
set file type of (file theFIle as alias) to "TEXT"
end if
end tell

Might be better?

(untested)


--
DODGEBALL STOPS AT THE GYM DOOR Bart chalkboard Ep. BABF12



Scott in Pollock

unread,
May 9, 2019, 6:21:12 PM5/9/19
to BBEdit Talk
On Thursday, May 9, 2019 at 11:12:51 AM UTC-7, @lbutlr wrote:
This will change the modification date for every clipping file in the folder, pretty sure.

Nope... it will only run on files that are added to the folder, when they are added. 
Reply all
Reply to author
Forward
0 new messages