Out of the box doesn't seem to be possible 🙁 BUT! I've found a workaround that works almost as nicely 🎉
There are paid apps out there, but we as developers should do it ourselves 👨🏻💻 To learn from it and to feel like a hacker.
💡 Create a bash script
I want to able to go quickly to a site from anywhere on my Mac. Sure that's what bookmarks are for, but you need to focus on Firefox, find the bookmark and click on it. That's just too much 😁
Imagine just typing a command in spotlight and be done with it ✅ The bash script below does exactly that.
- Opens Firefox Developer Edition
- Goes to the URL
- Terminal closes itself (I have configured Terminal to not ask for confirmation when closing with open processes).
open -a Firefox\ Developer\ Edition -g https://ricard.dev/wp-admin/
osascript -e 'tell application "Terminal" to quit'
As you know you can do practically anything with a bash script, so just let loose! It doesn't have to be my browser use case 😎
🤔 Easy find/write syntax
I've created my own syntax for naming the files
In the example below:
cdev.command will open my dev blog Dashboard in Firefox.
This syntax might not work for your brain just come up with something unique so Spotlight does not give you the wrong result.
If I'm watching a video with VLC and run the command it will open Firefox but it will not focus on that app. I've tried to use
activate but doesn't work. Ideas?
I've created a repo for them: https://github.com/quicoto/shortcut-commands