fort Posted August 29, 2014 Share Posted August 29, 2014 Hi all, I'm sure there's an easy answer to this, but could someone explain to me why a simple Keyword to Script workflow, consisting of a keyword foo and the following one-line bash script (where mate is the TextMate shell utility and bar is the absolute path to a text file) sudo mate bar does absolutely nothing, even though it works fine when I run it in Terminal,. This workflow used to work, but it hasn't for the past couple of months (I think, because I don't use it very often). It's not a huge deal, but I'd like to understand what's broken it. It's not because it's run with sudo, because mate bar does nothing (where bar is in my home directory in this case), and neither is it a problem with mate, because vi bar doesn't work either. All my other Keyword to Script workflows are working fine, including a test one I just created with rm bar as the script. Any ideas as to why I can't invoke text editors in workflows? Thanks! fort Link to comment
dfay Posted August 29, 2014 Share Posted August 29, 2014 If you click the bug icon in the workflow and set the log to show All information for all objects in this workflow, what do you see there? Link to comment
fort Posted August 29, 2014 Author Share Posted August 29, 2014 I get Starting debug for 'Edit hosts' [ERROR: alfred.workflow.action.script] Code 1: sudo: mate: command not found which suggests that the workflow needs the full path to any text editor (even though they're definitely in my PATH). I just tried it with the absolute path, and it now works. I'm wondering wtf has changed though, because this same workflow was working a couple of months ago. Many thanks for the tip, in any case. It immediately led me to the solution, and it'll be useful for future debugging! fort Link to comment
vitor Posted August 30, 2014 Share Posted August 30, 2014 even though they're definitely in my PATH But Alfred does not read your PATH, which is why it didn’t work. Alternatively to using the full path, you can define PATH at the top of the Run Script node. Link to comment
fort Posted August 30, 2014 Author Share Posted August 30, 2014 But Alfred does not read your PATH, which is why it didn’t work. Alternatively to using the full path, you can define PATH at the top of the Run Script node. Yes, I remember coming up against this problem before and I don't know why it didn't occur to me sooner. I think I was thrown by the fact that this workflow used to work (which doesn't make sense, in hindsight), and I didn't make any changes to it. Thanks. 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