JolinM Posted September 11, 2014 Posted September 11, 2014 Hey, I’m trying to have control Focus.app from Alfred. I found some scripts that should work on the developper’s GitHub. I just don’t know how to write them in Alfred nor in the Terminal. Here’s the script: #!/bin/bash open focus://focus And here’s my Workflow so far. Thanks for the help!
ctwise Posted September 11, 2014 Posted September 11, 2014 (edited) Hey, I’m trying to have control Focus.app from Alfred. I found some scripts that should work on the developper’s GitHub. I just don’t know how to write them in Alfred nor in the Terminal. Here’s the script: #!/bin/bash open focus://focus And here’s my Workflow so far. Thanks for the help! Create a keyword trigger (or hotkey trigger, or whatever you prefer), then create a run script action with 'open focus://focus' in the script box (don't enter the quotes in the box). Oh, and connect the trigger to the run script action. Edited September 11, 2014 by ctwise
JolinM Posted September 11, 2014 Author Posted September 11, 2014 Actually, that is exactly what I got, but nothing’s happening. I also tried to run the line in the Terminal, but I don’t know how I need to type in to make it works…
ctwise Posted September 11, 2014 Posted September 11, 2014 Actually, that is exactly what I got, but nothing’s happening. I also tried to run the line in the Terminal, but I don’t know how I need to type in to make it works… Create a text file and save the contents in it. Make it executable from the command line with 'chmod +x <scriptname>'. Run it from the command line './<scriptname>'
JolinM Posted September 12, 2014 Author Posted September 12, 2014 Hum :/ Not proud of myself here, and I feal kinda dumb, but even after reading a little bit more from what you told me, I have seriously no idea what I’m doing…! Here is my file script.sh #!/bin/bash open focus://focus And here is me trying to run it from terminal, and failling! Jolins-iMac:~ jolinm$ chmod +x /Users/jolinm/Desktop/script.sh Jolins-iMac:~ jolinm$ /Users/jolinm/Desktop/script.sh The file /Users/jolinm/focus:/focus does not exist. Jolins-iMac:~ jolinm$ .//Users/jolinm/Desktop/script.sh -bash: .//Users/jolinm/Desktop/script.sh: No such file or directory Jolins-iMac:~ jolinm$ /Users/jolinm/Desktop -bash: /Users/jolinm/Desktop: is a directory Jolins-iMac:~ jolinm$ ./script.sh -bash: ./script.sh: No such file or directory Jolins-iMac:~ jolinm$ chmod +x script chmod: script: No such file or directory Jolins-iMac:~ jolinm$ chmod +x script.sh chmod: script.sh: No such file or directory Jolins-iMac:~ jolinm$ /Users/jolinm/Desktop/script.sh The file /Users/jolinm/focus:/focus does not exist.
ctwise Posted September 12, 2014 Posted September 12, 2014 Hum :/ Not proud of myself here, and I feal kinda dumb, but even after reading a little bit more from what you told me, I have seriously no idea what I’m doing…! Here is my file script.sh #!/bin/bash open focus://focus And here is me trying to run it from terminal, and failling! Jolins-iMac:~ jolinm$ chmod +x /Users/jolinm/Desktop/script.sh Jolins-iMac:~ jolinm$ /Users/jolinm/Desktop/script.sh The file /Users/jolinm/focus:/focus does not exist. Jolins-iMac:~ jolinm$ .//Users/jolinm/Desktop/script.sh -bash: .//Users/jolinm/Desktop/script.sh: No such file or directory Jolins-iMac:~ jolinm$ /Users/jolinm/Desktop -bash: /Users/jolinm/Desktop: is a directory Jolins-iMac:~ jolinm$ ./script.sh -bash: ./script.sh: No such file or directory Jolins-iMac:~ jolinm$ chmod +x script chmod: script: No such file or directory Jolins-iMac:~ jolinm$ chmod +x script.sh chmod: script.sh: No such file or directory Jolins-iMac:~ jolinm$ /Users/jolinm/Desktop/script.sh The file /Users/jolinm/focus:/focus does not exist. You got it right, the script isn't working due to a problem with Focus, not with your script. You'll have to take it up with the Focus developer.
JolinM Posted September 12, 2014 Author Posted September 12, 2014 Well, at least I feel a little better about my (lack of) programming skills. I’ll try to contact him. Thanks for the support and follow up!
rice.shawn Posted September 12, 2014 Posted September 12, 2014 Basically, the problem is that the URI scheme isn't registered or registered correctly, and so the terminal is treating the string like a file and this not finding it. This might be a stupid question, but have you opened the app once? The URI scheme can be registered only once the app is opened, but then it should be good to go after that. If you have, then it's definitely the developer's error implementing the URI scheme.
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