Jump to content

Run script not working while terminal command works


Recommended Posts

I'm new to the update of alfred 2 and I'm having some problems when creating a workflow. i would like to run the following script:

cd /application/language/nl_BE/LC_MESSAGES/
grep -v '^#: ' common.po > common.po.tmp && mv common.po.tmp common.po

It works perfectly when I choose 'Actions -> run script' but nothing happens while when I use 'Actions -> terminal command' it works.

Screen_Shot_2014_01_07_at_16_55_53.png

Link to comment

I'm new to the update of alfred 2 and I'm having some problems when creating a workflow. i would like to run the following script:

cd /application/language/nl_BE/LC_MESSAGES/
grep -v '^#: ' common.po > common.po.tmp && mv common.po.tmp common.po

It works perfectly when I choose 'Actions -> run script' but nothing happens while when I use 'Actions -> terminal command' it works.

Screen_Shot_2014_01_07_at_16_55_53.png

 

Since you are new to Alfred 2, let me explain the difference in case it wasn't already obvious.

 

A run script (with the language set to bash) is the same as running the command from the terminal except it runs it in the background with no new windows popping up.

Terminal command will launch a terminal window and run the command in that new window.

 

If a command works normally in a Terminal Command item, then it should work normally as a Run Script with the language set accordingly as long as the script isn't reliant upon something in your profile settings or environment variables. Alfred doesn't import your environment so, if you have environment variables set that the script would need access to, these would need to be brought into Alfred. Also, paths in Alfred are relative to the folder that the workflow is stored in. So if you needed to access something in your documents folder, you wouldn't just use "cd Documents" assuming that you started in your home directory, you would have to specify full path to your Documents folder.

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...