Switch between Development and Production Environments With Custom Alfred Workflow

Switch between Development and Production Environments With Custom Alfred Workflow

Probably my most used custom workflow.

Create a new workflow. Start with a input Keyword that takes in no arguments, for me I used “switch

Next an action Script with Apple Script to grab the current URL of the foremost browser:

Then I used another action Script to take the URL and modify it, I did this with a PHP, accepting input as {query}.

This will be different for everyone, but my only differences between local and remote are http/https and .loc/.com:

With our new URL, we simply add an action of Open URL, and thats it. Now while browsing the local version, cmd+space switch opens the site in production, and vice-versa.