krike Posted January 7, 2014 Share Posted January 7, 2014 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. Link to comment
jdfwarrior Posted January 7, 2014 Share Posted January 7, 2014 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. 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. Alec 1 Link to comment
krike Posted January 8, 2014 Author Share Posted January 8, 2014 Yes I did read about the fact that whatever works in terminal works in run script. But thanks for the tip about the path, that solved the problem. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now