Jump to content

workflow request - url replacer


Recommended Posts

workflow request:

 

As I often use local url and demo server url, so I have situations when I need to change url from: www.simple-example-demo.com to www.simple-example.dev or another custom local url (www.s-e-d.dev and etc).

If anyone can create workflow with: url replace or .com replace or when I paste url it's converted to local automaticaly (like creating url store (in/out urls)) ?

Thanks.

Link to comment

This isn't a workflow, but you could just play with your /etc/hosts file to change between dev and live.

 

So, if you want, you can do:

 

# server.com # Live server. If you want to look at this, then comment out the two lines below.

192.168.0.1 server.com # Dev Server

# 168.0.0.1 server.com  # Testing Server

 

Unfortunately, you can't have includes in the host file, so it's hard to edit it easily.

Link to comment

Well, if you want the simplest execution, you can hardcode the URLs. So, what you'd want to do is, when you invoke the keyword, you can grab the clipboard contents (the premise here is that you'd need to copy the URL you want to replace it), and then you'd have a "run script" that could easily just store the "original" as a key in an array with the new one as the value of an array. For the output of that script, you'd just want to do the equivalent of 'echo $array["{query}"];', and then you'd pass it to a clipboard action where you'd have the option to paste automatically.

 

Making a workflow so that it could be extended easily for the different domains without hardcoding them wouldn't be too, too hard, but it would require a significant amount of work.

 

Using Alfred, you won't be able to make this happen automatically (in a TextExpander style); the closest you could come would be to set a hotkey (say cmd+opt+v) to run the workflow when you paste the URL.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...