martiin Posted January 24, 2021 Share Posted January 24, 2021 My workflow should like the following: - When I enter the keyword `randy` - Alfred searches for a random markdown file with folder XY - The output gets opened with my Markdown editor (iaWriter) What I tried: - ✅ Keyword setup - ✅ `find FOLDER_NAME | /usr/local/bin/shuf -n 1` (returns a filename with complete path) - ✅ Output filename in large type (shows me full path) - 🛑 (v1) Open File; Setting: "Open the passed-in file" WITH "iA Writer" - 🛑 (v2) Run script (Bash): `open $query -a /Applications/iA\ Writer.app` - 🛑 (v3) Open URL (using iaWriter URL scheme): `ia-writer://open?path={query}` How could I solve this challenge? Link to comment
deanishe Posted January 24, 2021 Share Posted January 24, 2021 3 hours ago, martiin said: `find FOLDER_NAME | /usr/local/bin/shuf -n 1` (returns a filename with complete path) It returns a complete path plus a newline, which is not a valid path. gingerbeardman 1 Link to comment
martiin Posted January 24, 2021 Author Share Posted January 24, 2021 Thanks, the was the hint I needed. I got it working with v1 and the following script: find FOLDER_NAME | /usr/local/bin/shuf -n 1 | tr -d '\n' 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