Jump to content

Run Terminal command to clear the multiple entry in "Open with"


Recommended Posts

I dont understand how the "Keyword to terminal command" workflow works.

 

I am trying to simply run silentely if possible (do not need to see the terminal poping up) the following command:

 

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

 

This command clear the "Open with" menu from multiple entries. I usally run it from the terminal but I thought I could do a simple straightforward Workflow. I dont know how to run this in the background without having the terminal window coming up.

 

Any help appreciated.

 

 

 

 

 

 

Link to comment

I dont understand how the "Keyword to terminal command" workflow works.

 

I am trying to simply run silentely if possible (do not need to see the terminal poping up) the following command:

 

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

 

This command clear the "Open with" menu from multiple entries. I usally run it from the terminal but I thought I could do a simple straightforward Workflow. I dont know how to run this in the background without having the terminal window coming up.

 

Any help appreciated.

 

To run silently, try using the Keyword to Script template. This would run in the background and allow you to execute code written in bash, ruby, python, php, etc.

Link to comment

I've made a workflow for this, it's easy as pie.

 

1: Create new workflow from templates/essentials “Keyword to Script to Notification”

2: Double click on the keyword icon, type in your preferred "Keyword" and then select "No Argument". Also type in a "Title" and a "Subtext" then click save.

3: Double click on the run script icon, and in the script area paste:

 

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user;
killall Finder;
then click save.
 
4: Double click on the notification icon. Output to whatever you want … I select Default. In "Title" I put “LaunchServices DB repaired”, and in "Text" I put “All done now” ,,, last two checkboxes un-checked, and select save.
 
So when you type your keyword and hit enter the script will run, clearing the database, and relaunching Finder, then a notification pops up saying it's all done.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...