Jump to content

Open Terminal and execute script from keyword


Recommended Posts

In Alfred v1 I am able to run a shell script in a terminal window by disabling "slient" and enabling "action".

 

I can't seem to duplicate this functionality with the new workflows, I think I've tried all combination I would think would work.

 

 

Keyword "Hosts" runs script within terminal window.

cd /etc
sudo vim hosts

 

Link to comment

Invoking Alfred, and then typing the following works fine for me:

 

> cd /etc; sudo vim hosts

 

 

From within your workflows, it looks like Alfred uses the following Applescript to process the ">" action. Should be easy enough to duplicate and use in your own workflows.

 

on alfred_script(q)
	tell application "Terminal"
		activate
		do script q
	end tell
end alfred_script
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...