pwc Posted March 28, 2013 Share Posted March 28, 2013 I'm trying to create a File Action workflow to open selected files in Kaleidoscope (a diff tool). There are two steps in the workflow: A File Action, named "Compare in Kaleidoscope", that accepts multiple files. A Bash script that runs "open -a Kaleidoscope {query}" The Bash script has all six escaping checkboxes checked. There is no option to escape a single quote character, though. As a result, this breaks when comparing files that contain a single quote in the filename. On Twitter, @alfredapp suggested wrapping {query} in double quotes and escaping the double quotes. This broke the workflow, I'm guessing because it looks to the Bash script that {query} is a single argument. Any suggestions on how to get this to work? Link to comment
Andrew Posted March 28, 2013 Share Posted March 28, 2013 I'm trying to create a File Action workflow to open selected files in Kaleidoscope (a diff tool). There are two steps in the workflow: A File Action, named "Compare in Kaleidoscope", that accepts multiple files. A Bash script that runs "open -a Kaleidoscope {query}" The Bash script has all six escaping checkboxes checked. There is no option to escape a single quote character, though. As a result, this breaks when comparing files that contain a single quote in the filename. On Twitter, @alfredapp suggested wrapping {query} in double quotes and escaping the double quotes. This broke the workflow, I'm guessing because it looks to the Bash script that {query} is a single argument. Any suggestions on how to get this to work? With multiple files, the {query} is passed in as tab separated. It's best to separate {query} into variables before using the open command, and wrap those with quotes, then pass the two separate arguments as necessary. There should be a few examples of this on the forum, maybe a user can help you out with this as I can't spot one at this point. Link to comment
Andrew Posted March 28, 2013 Share Posted March 28, 2013 Maybe something similar to this: http://www.alfredforum.com/topic/1215-multiple-query-inputs/ but separating by '\t' instead of ' ' Link to comment
Andrew Posted March 28, 2013 Share Posted March 28, 2013 Or this may be a better example: http://www.alfredforum.com/topic/771-working-with-multiple-selected-items/ 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