GoOz Posted March 19, 2013 Share Posted March 19, 2013 Hi guys, i'm experiencing a weird issue here. I open iterm, type a basic open command and it works juste fine. I use the terminal / shell tool in Alfred, it works just fine too. I copy/paste this command in a Run script object in a workflow and nothing happens. Because i can't see errors, i got no idea what's going on. Any clue ? :/ Link to comment
Andrew Posted March 19, 2013 Share Posted March 19, 2013 Hi guys, i'm experiencing a weird issue here. I open iterm, type a basic open command and it works juste fine. I use the terminal / shell tool in Alfred, it works just fine too. I copy/paste this command in a Run script object in a workflow and nothing happens. Because i can't see errors, i got no idea what's going on. Any clue ? :/ The Run Script object doesn't import your profile, so you likely need an absolute path to the command you are trying to run. What command are you trying to run? Link to comment
GoOz Posted March 19, 2013 Author Share Posted March 19, 2013 The Run Script object doesn't import your profile, so you likely need an absolute path to the command you are trying to run. What command are you trying to run? A basic open : open -a ~/Applications/Aurora.app 'path/to/folder' The tricky thing is that that Run script runs fine on my personal MB but on my iMac, at work, nothing happens. The main difference between the two configs is that i got admin rights on my personal, but not at work. Could it explain things ? Link to comment
Andrew Posted March 19, 2013 Share Posted March 19, 2013 That should work fine! I wonder if ~/ isn't resolving correctly at work... maybe try the full path to Aurora.app? Link to comment
GoOz Posted March 19, 2013 Author Share Posted March 19, 2013 Ok so Aurora is installed in "Users/myprofile/Applications/Aurora.app" i tried in iterm open -a /Users/myprofile/Applications/Aurora.app it works but don't work anymore if i add the ~ Still won't work in Run script object with or without the ~ Just out of curiosity, i added an script with a "pwd" command and it gave me that output : "/Users/myprofile/Dropbox/configs/Alfred2/Alfred.alfredpreferences/workflows/user.workflow.IDXXX" I don't know if it actually makes sense or not, but i'm a little bit confused and lost Link to comment
Andrew Posted March 19, 2013 Share Posted March 19, 2013 Workflow scripts pwd is set to the workflow's folder so you can refer to scripts and resources as ./ If you echo out ~/ does it show your home folder? I suspect this is somehow incorrect. You could also just use: open -a Aurora Link to comment
GoOz Posted March 19, 2013 Author Share Posted March 19, 2013 echo ~/ gives me "/Users/myprofile/" I don't get why nothing i tried so far doesn't work. I tried "open -a Aurora", still nothing. :| Link to comment
jdfwarrior Posted March 19, 2013 Share Posted March 19, 2013 echo ~/ gives me "/Users/myprofile/" I don't get why nothing i tried so far doesn't work. I tried "open -a Aurora", still nothing. :| Hey man, can you provide us with a screenshot of the settings and such of your Run Script module, and possible the layout of the Workflow as well? That will help me better assess what's going on if I can see your config. Thanks Link to comment
GoOz Posted March 19, 2013 Author Share Posted March 19, 2013 Sure. FYI, i ran some more tests.Alfred does find Aurora. If i don't specify any arguments, the script opens Aurora. So It's not what i think it was. I'm wondering if the {query} is really passed correctly though. Anyway, here are the screenshots. Here is my workflow: Note that the output object "Post Notification" if for testing purpose only. Then i have a first Script (don't know if it's useful or not for you) that translate a DOS path (the {query}) into a Unix path: And finally the script that open (well, *should* open) the translated {query} into my browser Aurora: Hope it helps. Link to comment
jdfwarrior Posted March 19, 2013 Share Posted March 19, 2013 Sure. FYI, i ran some more tests. Alfred does find Aurora. If i don't specify any arguments, the script opens Aurora. So It's not what i think it was. I'm wondering if the {query} is really passed correctly though. Anyway, here are the screenshots. Here is my workflow: Note that the output object "Post Notification" if for testing purpose only. Then i have a first Script (don't know if it's useful or not for you) that translate a DOS path (the {query}) into a Unix path: And finally the script that open (well, *should* open) the translated {query} into my browser Aurora: Hope it helps. This seems fairly straight-forward. Assuming you pass a path into the workflow via the keyword? Stupid question but does the path passed to it happen to have a ' in the path? Tried wrapping the {query} in double quotes instead? Link to comment
GoOz Posted March 19, 2013 Author Share Posted March 19, 2013 Yes, i pass the path via the keyword. Actually, your question is not that stupid! I can't tell you right now, not until Thursday (tomorrow's day off), but i'll definitely keep you posted.Thanks. Link to comment
GoOz Posted March 21, 2013 Author Share Posted March 21, 2013 This seems fairly straight-forward. Assuming you pass a path into the workflow via the keyword? Stupid question but does the path passed to it happen to have a ' in the path? Tried wrapping the {query} in double quotes instead? So… i've been investigating. Tried many things to spot the filthy glitch. I finally realised that the output has an extra carriage return, just before the closing quote i guess, which could explain why my command open with firefox doesn't work. To be sure i made a test by adding another notification output : Nb: In the first script i just put an "echo "foobar"" The first notification has a {query} in the input Text. The second has "foobar" in the input Text. And this is what i got: You can see that the first one has an extra space. Do you think it's a bug and if so, i should post it in the bug section of this forum, right ? Link to comment
GoOz Posted March 22, 2013 Author Share Posted March 22, 2013 OK, got it. Don't know why but it seems that, after my sed, my {query} had a trailing newline. I added "tr -d '\n' at the end because having "echo -n '{query}'" didn't change anything, so now we're done. Finally works like i wanted 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