I'd like to associate different sets of pdf files to open with different applications depending on in which path these reside. All files are typically in different places. Some exists inside bundles. These can be pdf files or other specific types of documents.

The end objective is to have these files open with a specific application only associated with these file sets when you open them, also indirectly, that is not manually, like when applications opens its help document or you open from Spotlight results.

One acceptable way would be search and batch change the association of the search list, as these file sets change not too often. I've tried Path Finder, File Buddy and Find Any File so far, but none can do both, i e find files everywhere, also inside bundles, as well as treating the results with batch changes. Even if I manage to find files with the latter app I see no way to do batch change.

I also looked into lsregister but that would seem to only be regarding all associations for all files of a specific type.

Can you share any suggestions on how to do batch changing of a found set of files residing also inside bundles?

  • But I'm not asking for an automated determination of this necessarily. That's why I wrote "One acceptable way would be search and batch change the association of the search list" and pose the main question about "batch changing of a found set of files residing also inside bundles". You're saying this is impossible? – MiB Feb 19 '17 at 14:20
  • Having reread the OP and some initial testing, a given file with the same file extension as another file can be set to open with two different applications. In other words, by default PDF documents open with Preview and in testing, file1.pdf by default opens with Preview while file2.pdf opens with Skim, even though by default PDF documents open with Preview. The latter is done by way of extended attributes being applied to file2.pdf in the form of a com.apple.ResourceFork. I was then able to copy this com.apple.ResourceFork to the other and it too then opened with Skim. So, it's doable. – user3439894 Feb 20 '17 at 3:08
  • With further testing I was able to assign the contents of the com.apple.ResourceFork to a variable in a bash script to then act upon other PDF files in a given location. That said though, this method could step on an existing com.apple.ResourceFork containing additional information that you might not want to be overwritten. So that is why I'm posting this as comments until I can find a way to add info to an existing com.apple.ResourceFork to allow the change in which application it opens in aside from the file extensions default. – user3439894 Feb 20 '17 at 3:08
  • Sounds like an interesting approach. Thanks for trying. I'm thinking this should be scriptable targeting the AS properties of each file, though I'm not certain where exactly is the best property, but this is manually settable in Finder with "Open With" also for multiple files residing in different locations. As Finder can't get to files in bundles, at least I haven't found a way to make it do that, how to create and then where to get the list of files seem as important steps to solve. – MiB Feb 20 '17 at 15:59
  • "AS properties" ? – user3439894 Feb 20 '17 at 17:04

You must log in to answer this question.

Browse other questions tagged .