0

When I double-click, for example, a pdf file which is in the Desktop folder, I'd like it to be opened with Acrobat Reader.

However, if the file is in any other folder, e.g. Downloads, I'd like it to be opened with Preview.

Is that possible? Perhaps through an Automator script?

1

I created the following APP with Automator and select it as the default APP to open PDF files. enter image description here

  • This is good answer, but overkill for a simple drag n drop of 2 actions. Especially if the OP doesn't know how to shell script. +1 upvote though – soulshined Jan 29 '15 at 20:38
0

It should be possible. Automator has a Set Application for Files action which says:

This action selects the application used to open the specified files. If an application is chosen, it overrides the default application used for the type of file.

A Folder Action type of automator workflow could be set up to detect when new files are added to, in your example, the Desktop folder, which would then need to be filtered down to a specific file type using Filter Finder Items and then set the application for those files.

Alternatively, an paid app such as Hazel could do the legwork on detecting which folders and files you wish to change, and have it run a simpler workflow which would only need to set a desired application on any files it is given.

The problem, as I see it, would be what happens when you move those files out of that folder (in your example, off the desktop)? They would still have their non-default application set. With the above methods, one solution would be to have a separate folder for "cleaning" which acts in the same way, only setting the application back to your chosen default.

I believe it may be possible to do watch for files added to and removed from a folder using the Applescript Folder Actions which can also be added to a given folder, but it's not something I've experimented with.

  • Your almost correct D.G., instead of stealing this answer from you i'll play nice and just offer you to correct a few minor details. For one, your problem paragraph is inaccurate, once you set up a folder action within Automator, it only works for the folders you specify, once the files are taken out of the folder it goes back to system default application. So no need for a cleaning folder, additionally, this can all be done for FREE using resources from Mac, no reason to suggest a 3rd party app. Try including a brief tutorial to make it more concise to the OP, otherwise not a bad answer – soulshined Jan 29 '15 at 20:25
  • @soulshined Thanks for the comment, but a file which has had it's default application set by a folder action workflow does not return to the system default if the file is removed from that folder in my testing. It is the equivalent of Get Info->Open with and stays with the file. I am aware this can be done for free, which is why I led with the automator solution. However, if the OP (or future reader) already has an app which makes this easier, or has a more complex use case than the simple example which was given, they may feel it's worth the investment, so it's worth mentioning. – D.G. Jan 29 '15 at 20:42
  • You may be altering something within System Preferences elsewhere - when tested with Automator i have successfully demonstrated this. I will offer an answer then for the OP to review – soulshined Jan 29 '15 at 20:43
  • @soulshined I'm interested in reading any solutions which avoid this issue. – D.G. Jan 29 '15 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .