Jump to content
I have no display name

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...