Jump to content


  • Content Count

  • Joined

  • Last visited

About kerim

  • Rank

Recent Profile Visitors

471 profile views
  1. While that worked on a single line, I needed to change /g to /gm to do mult-line search. Then I needed to remove the "escape regex" line to be able to use more complex search operators. I also found that certain perl regex operators didn't seem to work for me. For instance instead of ^\s{4}- I had to enter ^ - (with actual spaces). I don't know why? I tested the above syntax on some online regex testing sites and it worked...
  2. Found an example that made more sense to me. This works! $query = "{query}"; my $find = "apple"; my $replace = "pear"; $find = quotemeta $find; # escape regex metachars if present $query =~ s/$find/$replace/g; print $query;
  3. Some research tells me that Perl is a good scripting language to do this in, and I can find examples online, but I don't know how to work them into the right format for use with Alfred Workflows. This is what I have now, but it isn't working... (trying to replace "apple" with "pear" as a test) $query = "{query}"; -p -e 's/apple/pear/g;' $query print $query;
  4. " Why would you expect Chrome (or any web browser) to be able to open a bear:// URL? It's entirely meaningless to any application except Bear." You seem to think it laughable that someone would not understand the difference between "the default browser" and the actual default browser. I really appreciate all the time you've taken to help me out, but I don't consider this laughable or obvious at all.
  5. Here is a sample workflow that shows what I am trying to do. I want to do a RegEx search and replace like this: Find "apple" and replace it with a carriage return. Normally one would use \n or \r To do this in Regex, but I just end up with the character "n" or "r" in my text?
  6. Thanks so much @deanishe! I got it working. As you say, the normalise command does not seem to matter. One strange thing that someone might want to look into is that it did not work if it was set to "Chrome" but did work if it was set to Safari, or set to the "default browser" - even if the default browser is Chrome!
  7. Thanks so much! Unfortunately there is something weird about the link you posted, while my mouse turns to a pointer over all the other links, somehow that one isn't registering as a link for me, so I can't download the file.
  8. Thank you everyone for the quick responses. Here's a link to the workflow. But the reason I didn't share it is that I'm not a programmer and I've just created this by merging two scripts I found that were written by other people. I would rather just know the best practice for doing this rather than trying to fix this code, as I've probably made things much more complicated than they need to be if you actually know what you are doing. I just need to take the output of some text and URL-encode it before passing it on to the URL. I am happy to use examples from any "real programming language" if
  9. UPDATE: I found a workflow to encode/decode text which handles URL encoding, however it doesn't output the results in the format I need. I've opened an issue for that on Github
  10. I'm writing a workflow that uses Bear's x-callback-url scheme. I got it to work, but I keep running into problems when my text contains certain ASCII. For instance, I have to write %23 instead of # or it won't work. Is there some way to automate this, so that the final output is properly escaped? I searched but couldn't find anything. Thanks!
  11. Thanks. The first one is exactly how I think Alfred should work by default.
  12. Is there a command I can type to get a list of all the phrases used by Alfred or my installed Workflows? I can't remember them all and it would be handy to have an easily accessible cheatsheet. Maybe such a feature is already built in? Thanks...
  13. I type "w zh 中華民國" and expect to find the Chinese language wikipedia page for Taiwan, instead I am given search results for the English version of the page. Am I doing something wrong?
  • Create New...