December 2nd, 2009 by Jon
Sigh – and I thought we had everything completely tested this time…
You can get the new release of Default Folder X from the What’s New page, or just download it using this link:
http://www.stclairsoft.com/cgi-bin/dl.cgi?DX
Version 4.3.5 of Default Folder X remedies two things:
- In Adobe InDesign, Photoshop, and other Carbon applications, Default Folder X’s windows and controls could be left on-screen after a Save dialog went away. This will no longer happen in 4.3.5.
- The latest version of OpenMeta uses a different metadata keyword for storing tags in the extended attributes of files (this was not my choice). Because of this, it needs to ‘upgrade’ any tags that you’ve already attached to your files – it searches for them with Spotlight and makes copies of them under the new names. This is necessary if you want Default Folder X (and other OpenMeta-based tagging tools) to continue reading them, but can bog down your machine if you have lots of tagged files.
Default Folder X will normally do this upgrade automatically. It does, however, take time and resources, so DFX now contains a hidden switch that lets you turn off this upgrade process until you’re ready for it to run. To get to it, option-click on the Settings button in the DFX preference pane. You’ll get this window:

Just turn on that “DisableOpenMetaUpgrade” checkbox at the bottom. Remember that you DO need to run the OpenMeta upgrade eventually or you’ll find that old tags won’t show up when you look at them with Default Folder X (though they’re still there).
The one situation where you might want to leave OpenMeta upgrading disabled is if you’re using MailTags to tag your email messages and won’t need to access those tags with DFX or any other OpenMeta tagging tool.
Sorry for providing another update so quickly after the last, but it was important to get these changes out, especially #1. We don’t want you to have problems with Save dialogs!
Posted in Default Folder X, openmeta | 7 Comments »
December 1st, 2009 by Jon
Posted in Code, Default Folder X, openmeta | No Comments »
November 6th, 2009 by Jon
Posted in Default Folder X | No Comments »
November 6th, 2009 by Jon
So, Apple added this cool little capability to the Launch Services API in Leopard: LSSharedFileListAddObserver will call your observer function whenever there are changes in a number of different file lists maintained by Launch Services. One of those lists is the “Recent Documents” list in the Apple Menu. ”Great!” I thought, “I’ll roll this into Default Folder X to ensure that it doesn’t miss any recently used folders.” It’s a simple API – what could go wrong? As a long time developer, I should have known better – if you EVER say this (even if you never even say it out loud), you need to poke yourself with something sharp and realize that the consequences will probably hurt quite a bit more than that. “What could go wrong?” indeed.
So yes, here I am apologizing for not having poked myself after I used LSSharedFileListAddObserver without asking more questions – or at least without testing more. Here’s how Default Folder X ended up using 60% of some users’ CPUs while doing nothing useful:
- DFX added itself as an observer for kLSSharedFileListRecentDocumentItems.
- The observer function got called by Launch Services because the user double-clicked a document in the Finder.
- DFX looked at the list, took the most recent entry in it (the first one), asked Launch Services for the URL of the document, and added the folder enclosing that document to its Recent Folders list.
Pretty simple, right? Yeah, I thought so too. This was tested thoroughly on Snow Leopard and performed fine, and all my Leopard testers reported that it worked well for them too.
So what’s the problem then? Well, there’s this little “issue”… If a user has a Windows server mounted on the Desktop, things get a little more interesting. Normally, when Launch Services calls your observer function, it hands you the file list and you ask for a copy of the list. The list itself is just a series of ID’s and references – to see what’s in an entry, you have to call LSSharedFileListItemResolve(). And that’s where the interesting part happened. On Leopard, if the shared file list item lies on a Windows server, the act of calling LSSharedFileListItemResolve actually results in the item being changed, so your observer function gets called again the next time you hit your event loop. The result of this is that you get called over and over again if you naively use LSSharedFileListItemResolve to get more info about the items that Launch Services is handing you.
So – the warning: If you use LSSharedFileListAddObserver to watch the list of recent documents, keep a copy of the ID’s from the previous call and ONLY call LSSharedFileListItemResolve if there’s a new ID in the array. Otherwise do nothing, or work off cached information – otherwise you’ll end up in an infinite loop, sucking down lots of CPU time. And if you’re doing anything that interacts with the filesystem, make SURE you test with SMB shared volumes too.
Posted in Code, Default Folder X, Development, Leopard | No Comments »