Florian Posted October 31, 2014 Share Posted October 31, 2014 (edited) Hello everyone, here's a new riddle for you: Why would a command like the one below work perfectly in a Run Script Action but not so well in a Script Filter Input? /usr/bin/terminal-notifier -title "Hello" -message "This is a message" -sender com.runningwithcrayons.Alfred-2 & What happens exactly is that in the case of the script filter the notification only appears in the notification center but never shows up on the top right corner. It behaves normally in the case of the run script action. PS: my goal here is to notify the user that some data is loading and that they shouldn't worry (since it can take up to about 10 seconds sometimes). PPS: it does work when not sent as Alfred (remove `-sender com.runningwithcrayons.Alfred-2`) but that's not what I want... Edited October 31, 2014 by Florian Link to comment
rice.shawn Posted November 3, 2014 Share Posted November 3, 2014 Have you tried: /usr/bin/terminal-notifier -title "Hello" -message "This is a message" -sender com.runningwithcrayons.Alfred-2 >/dev/null 2>&1 & ? If that doesn't work, then you could go a bit more overkill by prepending `nohup`: nohup /usr/bin/terminal-notifier -title "Hello" -message "This is a message" -sender com.runningwithcrayons.Alfred-2 >/dev/null 2>&1 & Link to comment
Florian Posted November 3, 2014 Author Share Posted November 3, 2014 The most radical solution works. I haven't tested the other yet. So why is this, out of curiosity? Link to comment
rice.shawn Posted November 4, 2014 Share Posted November 4, 2014 So, my guess is that Alfred has opened the STDERR and STOUT pipes, and it won't do anything until those pipes are closed. Since those pipes remain open until the entire workflow finishes running, it sends them at the end. `nohup` detaches the output of the command from those pipes, letting it happen immediately. But again, that's my guess. 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