topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 1:15 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Launching URL files stored in the Windows file system  (Read 12115 times)

mostlytyping

  • Supporting Member
  • Joined in 2015
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Launching URL files stored in the Windows file system
« on: July 07, 2017, 03:48 AM »
I'm experimenting with storing bookmarks in folders and using FARR to access the bookmarks rather than browser menus and toolbars. Recently I changed from Firefox to Chrome and I'm finding it a problem because Chrome has very limited support for multi-row bookmark tool bars. As I find using FARR to be quicker than using the mouse, it would seem sensible to rejig my system so that it is not dependent on the particular browser I'm using at any one time.

What I had in mind was a base directory such as "C:\FARR\URLs" containing subfolders such as "news". The subfolders contain actual .URL files, saved in the file system itself. "Google News.URL", for example, consists of the following:
[InternetShortcut]
URL=https://news.google.co.uk/
IDList=
HotKey=0
IconFile=C:\Users\xxxx\AppData\Local\Mozilla\Firefox\Profiles\nrl83w0q.default\shortcutCache\GdUdndw+OdsSTiNrtiv9oA==.ico
IconIndex=0

So far, I have a search folder set up with "C:\FARR\URLs" as the path to be searched and (because FARR seemed to be searching in other areas as well) "+C:\FARR\URLs" in the restrictions box below. Finally I have an entry "uu uu = +uu" in the Quick Search Words box.

This has all been a bit complex, and it's still not working quite as I would like. For instance, if I enter "uu news" FARR shows me a couple of the URL files from the "news" subfolder but it also shows as the first choice the built-in "news" alias as well as a "newegg" alias that is also apparently built-in. At the end of this list of five items it also shows the "news" subfolder, but if I select this it simply opens that subfolder in Explorer.

What I would like FARR to do is show me (in a FARR list) the contents of the "news" subfolder straight away when I type "uu news" and the contents of other subfolders in the URL directory when I type e.g. "uu sport" and so on.

Can anybody give me some pointers as to how I should achieve this?

Thanks
« Last Edit: July 07, 2017, 04:05 AM by mostlytyping »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #1 on: July 07, 2017, 08:04 AM »
Let's see.. ok there are a few ways to do this.. And ironically there are a few others on the forum who are better at using FARR than me for these things :)

Let me assume your quick search words doesn't exist because that confuses me :)

So in your directory entry for "C:\FARR\URLs" if you put into "Optional Modifier Keywords": us

Then if you search for: +us news
It should ONLY search that folder for files matching the term new and should not search any other directories at all.



But you say you want it to show the entire contents of that directory when you search with no keywords, so instead what you could do is make an alias and use the restartsearch function to have it do a directory browsing/filtering.
For that you would make an alias regex trigger like us(.*)
and have result of "restartsearch C:\FARR\URLs $$1"
that should show the contents of the directory when you type us and then progressively filter it as you type keywords, the same as if you had directly typed in: C:\FARR\URLs EXTRA_KEYWORDS_HERE



Having said all that, another possibly MUCH EASIER way to do what you want is not to make separate shortcut files, but make one test file with all the urls you want, and put it in a text file and create a "us" alias that uses the "filecontents" command to let farr search it.

mostlytyping

  • Supporting Member
  • Joined in 2015
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #2 on: July 08, 2017, 01:29 AM »
Thank you for your helpful advice.

First, the reason I want to use shortcut files is that I can simply drag and drop my bookmarks out of Firefox and into the folder to create them. That's a lot less work than making individual entries in a text file. Having said that, I have investigated the filecontents command and it does work well. It's just a lot more time to set up.

On the subject of using an alias regex trigger, I cannot get it to work as you say should work.

Typing "C:\Farr\URLs extra_keywords_here", such as "C:\Farr\URLs Emacs" does work as we would expect - additional keywords filter down the results and no results from other folders are included. So far, so reassuring.

However, when I use the us(.*) approach it does not have the same effect, instead returning all kinds of files that are not related to the folder in question. My assumption is that I have set it up wrong, but looking at the following dialog I can't see what the problem is!

snap07216.pngLaunching URL files stored in the Windows file system

« Last Edit: July 08, 2017, 04:31 AM by mostlytyping »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #3 on: July 08, 2017, 04:38 AM »
You did exactly what I said do to but I mispoke -- the function you want to use is "dosearch" not "restartsearch".

It's dosearch that will do the live display and filtering as you type.
The function restartsearch only triggers when you hit enter.

mostlytyping

  • Supporting Member
  • Joined in 2015
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #4 on: July 08, 2017, 04:57 AM »
Thank you for that amendment. I have looked at the docs and that seems reasonable.
Unfortunately doesn't seem to make any difference. Here's the configured screen:

dosearch.pngLaunching URL files stored in the Windows file system

Here is the output if I use a direct reference to the path, which is exactly as I would expect - I get results only from that folder and its subfolders:

path.pngLaunching URL files stored in the Windows file system

And here is the output using that alias, which is not as I would expect - it includes results from everywhere and the hits from the folder in question are not even visible:

us.pngLaunching URL files stored in the Windows file system

So something is still wrong, but I can't see what it is.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #5 on: July 08, 2017, 05:02 AM »
It doesn't look like the alias is actually triggering in your bottom screenshot..
Are you sure it's enabled?
If so, try typing "us news" in the Test Regular Expression field of it just to make sure it's matching..

mostlytyping

  • Supporting Member
  • Joined in 2015
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #6 on: July 08, 2017, 05:18 AM »
I agree, it doesn't seem to be triggering. And yet the alias is enabled:

enabled.pngLaunching URL files stored in the Windows file system

And here the results of typing "us news" in the Test Regular Expression field - nothing.

nomatch.pngLaunching URL files stored in the Windows file system

I did try changing the alias trigger text to different strings, just in case there was some conflict somewhere with "us" but that did not help either.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #7 on: July 08, 2017, 05:29 AM »
From looking at your screenshot of Test Regular Expression here, it's clear that expression is not matching. 
Ha!

I just realized the problem -- yeesh you would think as the author of this program I would be a little quicker on the draw :)

Ok you are putting the regular expression in the "Alias Trigger/Keyword Text" field -- but that's not where it goes.  That's just for the NAME of the alias, or the first initial letters if you want to be able to search for it.

The next field BELOW it is where you put the regular expression.

That's why the "Test Regular Expression" is so useful -- it can help you verify that it's matching as expected.

So your alias should look something like this:
Screenshot - 7_8_2017 , 5_31_30 AM.png



Note that I'm not sure whether you need the final \ at the end of C:\FARR\URLs\ or not.

mostlytyping

  • Supporting Member
  • Joined in 2015
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #8 on: July 08, 2017, 05:49 AM »
Sorted! Many thanks for all your help.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #9 on: July 08, 2017, 05:56 AM »
Thanks for not giving up!  :up:

mostlytyping

  • Supporting Member
  • Joined in 2015
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #10 on: July 12, 2017, 09:26 AM »
Having said all that, another possibly MUCH EASIER way to do what you want is not to make separate shortcut files, but make one test file with all the urls you want, and put it in a text file and create a "us" alias that uses the "filecontents" command to let farr search it.
if you have time, I have a follow-up question. I have been experimenting with the command mentioned above, but I cannot get it to work. In this case I have it bound to nn, as follows. I would expect that typing "nn emacs" would lead it to show a filtered list of all the entries extracted from the file using the filecontents command. Instead it just shows all the entries, without filtering at all (see below). I cannot work out what is going on. And yet I have a memory of it working a few days ago, so I think I have changed something but I don't know what.

This is how I set it up:

snap07233.pngLaunching URL files stored in the Windows file system

These are the contents of the file to which the alias refers:

snap07232.pngLaunching URL files stored in the Windows file system

And this is the result when I try to use the alias:

snap07231.pngLaunching URL files stored in the Windows file system

Any pointers would be gratefully received...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #11 on: July 12, 2017, 09:28 AM »
Try putting $$1 in the the alias configuration dialog where it says "Result Filter for RegEx".

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #12 on: July 12, 2017, 10:49 AM »
Having said all that, another possibly MUCH EASIER way to do what you want is not to make separate shortcut files, but make one test file with all the urls you want, and put it in a text file and create a "us" alias that uses the "filecontents" command to let farr search it.


Thanks for this reminder.  I really need to set up FARR to use the more powerful features, but always forget.

wjamoe

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 99
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #13 on: July 12, 2017, 02:57 PM »
Or you can try this without an external file

Watch the space after nn (this will increase the speed, farr will recognize you alias early

As soon as you type nn[space] it will display the complete list of entries from the Result(s)

Typing nn em will get your emacs result

2017-07-12 , 21_55_45 - Edit Group Alias.pngLaunching URL files stored in the Windows file system

KR wjamoe

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #14 on: July 13, 2017, 10:43 AM »
I have a question now, trying to figure out this same thing - It shows the name of the file itself in the results, even though the location where the file is located is not in my search folders.  What might I be doing wrong?




wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #15 on: July 13, 2017, 10:44 AM »
Or you can try this without an external file

Watch the space after nn (this will increase the speed, farr will recognize you alias early

As soon as you type nn[space] it will display the complete list of entries from the Result(s)

Typing nn em will get your emacs result

[ Invalid Attachment ]

KR wjamoe

The reason that the file appeals to me personally, is that I store the file on dropbox, and can use it on any installation of FARR without retyping.  I also don't have to type it in the field in FARR, but just edit it in my favorite text editor.

mostlytyping

  • Supporting Member
  • Joined in 2015
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #16 on: July 14, 2017, 02:42 AM »
Try putting $$1 in the the alias configuration dialog where it says "Result Filter for RegEx".
Thanks to everybody for their help. It is now working as I want it to.
I did find that using nn(.*) led to far too many false hits, but now that I have tweaked the regex to nn(??.*) it behaves more usefully.
Oh, and I also had to change the trigger from 'nn' to 'uu' as the former is found in a fair number of English words, which meant that searching for something like 'kennel' using other aliases would trigger it.


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #17 on: July 14, 2017, 07:22 AM »
Oh, and I also had to change the trigger from 'nn' to 'uu' as the former is found in a fair number of English words, which meant that searching for something like 'kennel' using other aliases would trigger it.

That is best solved by changing the regex from nn(.*) to ^nn(.*) so that it only matches if the nn is at the START of the string.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #18 on: July 14, 2017, 08:40 AM »
I figured my problem out... thanks!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #19 on: July 14, 2017, 08:45 AM »
wraith -- I was going to reply to your issue but I couldn't think of anything useful.. what did your problem turn out to be?

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #20 on: July 14, 2017, 08:53 AM »
wraith -- I was going to reply to your issue but I couldn't think of anything useful.. what did your problem turn out to be?

Stupidity.  I had a header in the file so I'd know which file I was using as I separate mine into categories with different keywords.  Which brings me to a different question- is it possible to have comments in files that are overlooked when FARR searches?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #21 on: July 14, 2017, 08:55 AM »
I can't remember specifically but I normally check for lines starting with // to indicate comments. if it doesn't work let me know and i'll add it.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #22 on: July 14, 2017, 09:20 AM »
That worked. Thanks!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #23 on: July 14, 2017, 09:21 AM »
 :up:

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,540
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Launching URL files stored in the Windows file system
« Reply #24 on: July 15, 2017, 01:25 AM »
@mouser:
-- yeesh you would think as the author of this program I would be a little quicker on the draw   :)

This discussion rather seems to show that, despite a natural and quite human forgetfulness, your approach was/is consistent and your thinking was apparently working just fine when you wrote/updated the exceedingly nifty and useful FARR proggy:
I can't remember specifically but I normally check for lines starting with // to indicate comments. if it doesn't work let me know and i'll add it.

Kudos.    :Thmbsup: