OliverJAsh Posted January 17, 2013 Posted January 17, 2013 I'm trying to create a workflow that will allow me to easily toggle between output devices. I've found a command-line utility for that, so I've just got to write a little script for it to work in Alfred with a keyword. This script works if I run it from terminal in a separate file, but when I run the workflow, nothing happens. How can I get feedback from this script to help me debug, and is there any reason why it might work in terminal but not in Alfred? external_output="Oliver's AirPort Express" if audiodevice | grep "AirPort Express" then audiodevice output "Internal Speakers" else audiodevice output "$external_output" fi
jdfwarrior Posted January 17, 2013 Posted January 17, 2013 you could add an output item of "Copy to Clipboard" and attach that to the back end of your script item and I think that will push the errors to your clipboard OliverJAsh 1
davedelong Posted January 29, 2013 Posted January 29, 2013 A "Copy to Clipboard" output does nothing for me. Is there any other way of debugging workflow scripts that work great in terminal, but not at all in Alfred?
jdfwarrior Posted January 30, 2013 Posted January 30, 2013 It's been discussed, adding some kind of debugging ability into Alfred but a decision hasn't been made. Dave, have you tried checking Console.app to see if there is any kind of error output from there? Also, if you would like, I can look at the code for you as well and see if I can help you figure out the issue
CarlosNZ Posted January 30, 2013 Posted January 30, 2013 You want to know my dirty little debugging trick I use for shell scripts? I drop in Growl notifications (via growlnotify) when I want to check that the script is going where I want it to (following the right "if" options, etc.) with the variables assigned as expected. I'm sure seasoned programmers would look down their noses at such nonsense, but it works for me, for now. canadaduane 1
ClintonStrong Posted January 30, 2013 Posted January 30, 2013 It's not a perfect solution, but you can kinda sorta debug from Alfred if you set it up right. I posted about it in this thread, if you're interested.
davedelong Posted January 30, 2013 Posted January 30, 2013 It's not a perfect solution, but you can kinda sorta debug from Alfred if you set it up right. I posted about it in this thread, if you're interested. I ended up doing something similar (logging to a file), and that helped me realize I was trying to fetch way too much information and was blocking execution.
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