Messages - Nod5 [ switch to compact view ]

Pages: prev1 ... 16 17 18 19 20 [21] 22 23 24 25 26 ... 234next
101
Find And Run Robot / Re: regex default value if nothing entered
« on: October 12, 2020, 03:24 AM »
Discussion in another thread https://www.donationcoder.com/forum/index.php?topic=50563.0 got me thinking...

An alternative way to do what OP here wants withouth using an external AutoHotkey script is to set up multiple aliases, one for each possible use case.

case 1 would be your original example where all four parameters are typed. Let us call that alias 1. We could there use the regex wjamoe suggested which requires all four parameters to be typed.
regex: slicevideo\s+"([^"]+)"\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)
results:
shellexec /k "source file"=$$1 - cut time=$$2 - duration=$$3 - output name=$$4 | ffmpeg.exe -i "$$1" -ss $$2 -c copy -t $$3 -vf "\ffmpeg output\$$4.mp4"

case2 
Say I wanted to sometimes omit the last value "$$4", and if I omitted it then "$$4" would go to the default value of "untitled" so i'd end up spitting out a file "untitled.mp4"
covered by alias 2:
regex: slicevideo\s+"([^"]+)"\s+([^\s]+)\s+([^\s]+)
results:
shellexec /k "source file"=$$1 - cut time=$$2 - duration=$$3 - output name=untitled | ffmpeg.exe -i "$$1" -ss $$2 -c copy -t $$3 -vf "\ffmpeg output\untitled.mp4"

You can create additional sibling aliases for the other cases you want to cover.
The drawback with this approach is that it is unwieldy to overview and if you want to later on e.g. change the ffmpeg path you need to edit multiple aliases.

102
Find And Run Robot / Re: Openstreetmap alias(es)?
« on: October 11, 2020, 06:58 AM »
If you use plus characters "+" instead of spaces then it works as is. For example try searching
dir yonkers+ny long+island+ny
That's because FARR will detect the two parts as whole strings and the website will treat + in the URL as spaces.

Alternatively you can tweak the regex pattern in FARR to require quotes around the to and from strings
alias regex:
^dir "(.*)" "(.*)"$
alias results:
To: $$1 From: $$2 | https://www.openstreetmap.org/directions?to="$$1"&from="$$2"

To use that you would type in the FARR searchbox
dir "yonkers ny" "long island ny"

Note that you can keep both aliases, the one which requires quote marks and the one without, active at the same time. Because only one will trigger depending on if you type the quotemarks or not.

That would look something like this
1.png

and

2.png




103
Find And Run Robot / Re: Openstreetmap alias(es)?
« on: October 11, 2020, 03:32 AM »
Try this

Alias name: OpenStreetMap direction
Alias regex: ^dir (.*) (.*)$
Alias result:
To: $$1 From: $$2 | https://www.openstreetmap.org/directions?to=$$1&from=$$2

Things missing: A way to default the from location to ones current location. Selecting mode of transport (default is car). Such details should be findable on their wiki or help pages
https://help.openstreetmap.org/questions/73989/setting-the-initial-to-address-in-directions-by-passing-a-parameter-via-url

edit: sorry that gives an error, need to encode the & character. Will update later when more time. My mistake, it does work.

In general if you want to make or tweak these kind of website URL search aliases the keywords to google for is <site name> and URL query or URL search syntax or similar terms. The other thing to try is to type in a search on the website and see if the browser URL changes. Often the pattern to use is visible then. For example if we go to https://www.wikipedia.org/ and search for "ball" the URL changes to https://en.wikipedia.org/wiki/Ball , which means the FARR alias would be something like
alias name: wikipedia
alias regex: ^wiki (.*)$
alias result:
Wiki $$1 | https://en.wikipedia.org/wiki/$$1

104
Find And Run Robot / Re: Openstreetmap alias(es)?
« on: October 11, 2020, 02:34 AM »
Do you mean the "maps" alias in FARR's Core-Search.alias? In that case this should do it:

Alias name: OpenStreetMap
Alias regex: ^osm (.*)$
Alias result:
Open Street Map - $$1 | https://www.openstreetmap.org/search?query=$$1

If you also want an icon we can add that like so
Alias result:
Open Street Map - $$1 | https://www.openstreetmap.org/search?query=$$1 /icon=C:\some folder\openstreetmap.ico

The attached zipped openstreetmap.ico was made from this SVG
https://wiki.openstreetmap.org/wiki/File:Public-images-osm_logo.svg
put through this convertor
https://favicon.io/favicon-converter/

If you never use the google maps alias you can disable (uncheck) it in the alias settings and then instead use assign the "maps" alias prefix phrase for OpenStreetMap with this regex line
Alias regex: ^maps (.*)$

105
News: The issue happens on PC number 2 too after updating FARR on it to the latest latest beta , so perhaps this is a general issue with version 2.250? (Updated first post with this same info.)

Pages: prev1 ... 16 17 18 19 20 [21] 22 23 24 25 26 ... 234next
Go to full version