samkrauser Posted July 23, 2015 Share Posted July 23, 2015 Hi, First time posting here, looking for some help. I want to create a workflow that allows me execute my youtube-dl command in the terminal and I also want to create a folder to put the downloaded files in. So basically the workflow needs to cd to a directory(predefined) and then make a newly named folder (query 1) and then download the file(s) from the URL (query 2). I've done some looking around at having more than 1 query in alfred and I found some bin/bash script that works: #!/bin/bash # split the query into an argument array IFS=',' read -a qarg <<< "{query}" # set the x and y queries from the array x=${qarg[0]} y=${qarg[1]} But I'm not sure how to take those 2 queries and feed them into a terminal command within Alfred. Any ideas? Thanks in advance, I'm pretty new to this sorta stuff, but really loving Alfred and the stuff you can do! Link to comment
deanishe Posted July 23, 2015 Share Posted July 23, 2015 mkdir -p "$x" /usr/local/bin/youtube-dl --output "$x/%(title)s.%(ext)s" "$y" Link to comment
deanishe Posted July 24, 2015 Share Posted July 24, 2015 I think I misunderstood your question. Add the 2 lines I posted above to the bottom of the script you have (they will pass your arguments to youtube-dl), and then paste the whole lot in a Run Script action in Alfred's workflow builder. Set Language to /bin/bash and then connect it to your Keyword (where you enter your query). 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