Add Support For Smart Folders On Mac Os X


Haravikk

Recommended Posts

As the title says, I'd really like to see support on OS X for using a Smart Folder as a read-only shared folder in BT Sync, as it would give a huge amount of control over the content that is shared.

 

For those that haven't used them before, Smart Folders are basically just a search in the Finder that is saved as a persistent folder that can be revisited to see results matching that search. For example, I could create a Smart Folder showing all movie files of a certain type, tagged in a certain way, or added since a particular date etc.

 

 

Working with Smart Folders is fairly simple, as they're actually just XML files (you can open them in TextEdit), and you will see inside there is a RawQuery and SearchScopes (folders to search within) that can be used to perform the same search in Spotlight using its API (or mdfind), either way allowing you to easily grab the contents matching the query so that they can be checked for changes. In fact, both the API and mdfind allow the results of a search to be monitored for changes.

 

 

This would give an incredible amount of control over what BT Sync shares, without requiring us to first move or copy files into a shared folder (or use hard-links, which are all kinds of tricky to get right). The only caveat is that it should probably be be read-only, as reconciling differences would be a massive pain (and probably destructive). On the receiving side the "contents" of the smart folder would be just like any other regular folder of files, regardless of where the files are being pulled from on the sending side.

 

 

I expect that there are similar features on other operating systems by now, so support them would be great too, but I'm only familiar with Smart Folders on OS X.

Link to comment
Share on other sites

Not really. If BT Sync supported Smart Folders directly then it would allow any user to setup a shared folder matching only files from the last two weeks, with a certain tag, of a certain file type and so-on.

 

I'm currently achieving the same thing using hard-links, and to do that I'm using a shell script that creates them from the result of an mdfind search, but it isn't especially pretty. Symlink support would let me do this across volumes, and eliminate some of the headaches of hard-linking, but it wouldn't make it any easier for users who don't know a thing about scripting.

Link to comment
Share on other sites

Oh, maybe you're thinking of the Burn Folders used to write CD/DVDs? I think that's how those work, until you actually write them.

 

Smart Folders are actually just an XML file with a load of stuff that's mostly Finder specific, but in there is a raw query value which is actually just a Spotlight search.

 

The useful thing for BT Sync is that a Spotlight search query can also be watched for changes; so if a program does a search that returns 20 results, but some files are added that match the search, then it'll receive those too so it can perform any relevant updates. This should also include items that are removed from the search, or updated, so BT Sync should still be able to handle all the usual cases and sync them as if it were just one big folder. 

Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.