2

I'm trying to use Automator to create a simple service (open selected file in MacVim). Originally I (incorrectly) specified that the service accepts selected text as input. I have changed it later to accept selected files or folders but it is stuck in Service preferences under Text and not under Files and Folders, and also does not appear in Finder. Is there some way to refresh/reload the category of a service?

  • Have you tried deleting the /Users/$USER/Library/Services/$ServiceName.workflow file, reboot and then recreating it anew? – user3439894 Feb 6 '16 at 20:19
  • Yes, it ends up in the same category as before even if I recreate it properly. Something somewhere seems to remember (cache) categories of scripts by name. – Sergej Koščejev Feb 6 '16 at 20:22
  • The only other suggestion I have is to rebuild the Launch Services Database and restart Finder with the following command that you can copy and paste into a Terminal and then press Enter: /S*/L*/F*/C*/F*/L*/S*/lsregister -kill -r -domain local -domain system -domain user; killall Finder – user3439894 Feb 6 '16 at 21:11
  • @user3439894 Nope, it's still under Text. Also, all services are gone from the Finder context menu now - there used to be services from some applications. – Sergej Koščejev Feb 6 '16 at 21:33
  • If you'd add the Workflow to the question I'll see if I can replicate the issue. The missing Services should repopulate the next time the App offering the service is opened. Or you may have to log out/in. Those that do not reappear were probably orphaned to begin with. I've seen a truncated Finders Services list appear at Finder > Services but show the full list right after selecting an object in Finder and right-click > Context menu > Services and then go back to Finder > Services and it shows the full menu. It actually happened a few moments ago and I haven't rebuilt the LSD is some time. – user3439894 Feb 6 '16 at 21:55
1

The following steps solved the problem for me:

  1. Export the workflow from Automator (e.g. to Desktop).
  2. Click on the exported workflow. A dialog appears asking whether you want to open it or install it. Choose Install.
  3. Another dialog appears asking whether you want to overwrite the existing service. Choose Overwrite.

Now the service appears in the proper category.

You must log in to answer this question.

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