Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • December 10, 2016, 04:22:45 PM
  • Proudly celebrating 10 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

Author Topic: Dialog extension with FlashFolder and FARR2  (Read 5899 times)

jzippo

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 26
    • View Profile
    • Donate to Member
Dialog extension with FlashFolder and FARR2
« on: September 10, 2007, 03:55:29 AM »
This "release" has been updated according to the ideas that Mouser raised in this topic.

FlashFolder is a dialog extender; that is, it adds a new menu to the common file save/open dialog. It does so both for Word 2003 open/save dialogues and the standard ones. As you may know from a recent post, I wanted to have the possibility of sending the currently selected file or folder path to the currently open file open/save dialogue. By using FlashFolder and some scripts that I wrote you can now have this possibility. This is what you will have to do for this to work.

Download the file FlashFolder.zip attached to this post and unpack it in the FindAndRunRobot\AliasGroups\Installed folder. This should create a folder with FARR-aliases with the name FlashFolder in the FindAndRunRobot\AliasGroups\Installed folder.

You will also have to download CMDOW Commandline Window Utility and unpack it into the FindAndRunRobot\AliasGroups\Installed\FlashFolder directory (or have it accessible through the path environment variable) that was created when you unpacked FlashFolder.zip. The aliases also depend on NirCmd which you will have to place in this directory too (or have it accessible through the path environment variable).

Then get and install FlashFolder (this script is tested to version 1.8.141). Once installed, you will have to configure FlashFolder. You gain access to FlashFolder and its options by first selecting to save or open a file in any application that uses the standard save/open file dialog. FlashFolder will now appear as a toolbar above the file open/save dialog. Click on the button directly to the left of FlashFolder's text-field and select "Options..." in the menu that drops down (shown in the image below).

001_FlashFolderOptionsSelect.png

In the options, you should set the keyboard shortcut for the "Focus path edit field" to CTRL + ALT + G as shown in the picture below.

002_FlashFolderHotkey.png

Now, finally, we may test if this works as it should. To do this, start a file/open save dialog from your favorite application. Next, start FARR2 with your favorite keycombo and type in your search terms. Using the arrow keys, select the file of your choosing in FARR2's result box and press TAB. The topmost field of FARR will now become activated again and the path of the file just selected with TAB will have replaced the previously typed search terms. Now, to send the path to FlashFolder, you will have to type in +fos after the path and press RETURN. The following two images are meant to illustrate this process:

004_selectFOS.png
005_useFOS.png

You may also send a path to a file save/open dialog by preceding your search terms in FARR with the keyword lfos whereafter you type your search terms. The file or folder-path that you select in the result box will now be automatically sent to the currently open FlashFolder-dialogue.

The scripts that I wrote will send the path to FlashFolder upon pressing return in FARR, which in turn updates the currently open file dialog to show that directory. If the selected path points to a file rather than a directory, the name of the file will be inserted into the file name field of the current file/save dialog. The dialog is then made to open the file by my script sending a {RETURN} to confirm the dialog automatically. Note that in the process of sending a path to FlashFolder your clipboard is used and whatever is in there therefore becomes discarded.
« Last Edit: September 14, 2007, 01:25:22 AM by jzippo »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,435
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Dialog extension with FlashFolder and FARR2
« Reply #1 on: September 10, 2007, 04:25:06 AM »
That's great work, really wonderful to see people being so creative!

Now let's see if i can help you tweak it a little bit and optimize it for sharing 8)



You can make this alias+script a complete standalone package that anyone can use without any trouble, by simply creating a new alias file called FlashFolder.alias, with just your one alias in it. After you build it, i suggest actually placing it in it's own subdirectory called FlashFolder or something similar.

Then, put your script INSIDE the alias directory you just created, and change your alias from
%FARRDIR%Scripts\Joe\sendToFlashFolder.bat
to %ALIASDIR%Scripts\Joe\sendToFlashFolder.bat (or something like that)

In this way, the new alias pack you can create is just the FlashFolder subdirectory with no need for use to create a place in the scripts section.  Then you will just zip up the FlashFolder directory and people can unzip it in their alias directory to use it.



Ok now lets see if we can make your launch process a bit simpler..
What if you name your alias lfos (or anything really), and then create a new alias called fos
which looks like this:
Screenshot - 9_10_2007 , 4_20_45 AM.png

Then the user can simply type fos *.txt
and when they hit enter it will act as if they typed the result +fos
which will perform your action.
I'm not sure if i've done it 100% correctly but that's the basic idea.
nitrix is an expert at this kind of stuff and he may be able to fine tune and fix any mistakes i made.

You'll see the trick here is to use the dosearch feature to make a nice regular expression that transforms what they type into the result with the +lfos on the end.



You might also try adding /WINHID to the end of the alias command to hide the batch file window.

jzippo

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 26
    • View Profile
    • Donate to Member
Re: Dialog extension with FlashFolder and FARR2
« Reply #2 on: September 10, 2007, 04:54:22 AM »
Let's see if I am getting this right.

As I understand it, I could create a folder with the name FlashFolderFARR and in that folder I would put an alias-file that defines only the +fos alias. To do this I would just have to copy my current myaliases.alias to that folder and edit it so that it only contains the fos-alias. In the .alias file I would also have to change any mention of %FARRDIR%scripts\Joe to %ALIASDIR%. I would also change the current subdirectory "Joe" to the name of the folder in which I intend this alias to reside in when it is unpacked into the AliasGroups (in this case FlashFolderFARR). After this, I would also put the vbs and bat scripts into that folder after which I zip this folder. Once I have done that I could distribute the zip-file and tell people to unzip it into a folder with the name FlashFolderFARR in their AliasGroups folder.

I would also have to instruct them to download and place NirCmd and CMDOW Commandline Window Utility in the FlashFolderFARR-folder (or to make them accessible by modifying the environment variable PATH so that they are globally available).

Does this sound right?

« Last Edit: September 10, 2007, 04:57:36 AM by jzippo »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,435
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Dialog extension with FlashFolder and FARR2
« Reply #3 on: September 10, 2007, 05:05:17 AM »
yes, you've got it.

(and of course if you wanted to use the alias dosearch trick, then your fos.alias file would have 2 aliases in it.)

jzippo

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 26
    • View Profile
    • Donate to Member
Re: Dialog extension with FlashFolder and FARR2
« Reply #4 on: September 10, 2007, 05:14:06 AM »
Would I have to tell people to restart FARR2 after unpacking into AliasGroups? I have done what you've said and tried to test it, but I cannot see FlashFolderFARR in the list of group aliases within FARR.

This is the alias-file after i edited (its name is FlashFolderFARR.alias)

<?xml version="1.0" encoding="Legacy" ?>
<!-- This file defines aliases for use by the Find and Run Robot program (http://www.donationcoder.com/Software/Mouser/findrun/index.html). -->
<FarrAliasFile>
    <FileFormatVersion>1</FileFormatVersion>
    <AliasSetDescription>Aliases for integrating FARR2 with FlashFolder</AliasSetDescription>
 
    <AliasEntry>
        <AliasText>fos</AliasText>
        <Score>1000</Score>
        <DefaultSearchText>FlashFolderFARR.alias</DefaultSearchText>
        <Results>
            <Result>FlashFolder open $$1 | %ALIASDIR%sendToFlashFolder.bat &quot;$$1&quot;</Result>
        </Results>
    </AliasEntry>
   
</FarrAliasFile>


This is what the FlashFolderFARR-directory looks like in AliasGroups:

FlashFolderFARR.png

What have I done wrong?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,435
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Dialog extension with FlashFolder and FARR2
« Reply #5 on: September 10, 2007, 05:23:47 AM »
yes you need to restart farr -- or just open options and close options.
i'll be adding a simpler way to tell farr to rescan alias files, like from the tray menu, etc.

jzippo

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 26
    • View Profile
    • Donate to Member
Re: Dialog extension with FlashFolder and FARR2
« Reply #6 on: September 10, 2007, 05:33:19 AM »
Restarting farr and open options and close options does not seem to do the trick. Something else must be wrong, but I cannot figure it out. I placed the files in the FlashFolderFARR directory as in the image in the previous post and restart farr but the list of aliases still does not reflect these changes.

I have tried to rename the alias from fos to fso, changing the name of the .alias file to myaliases.alias, restarting as well as opening and closing options, changing the name of the folder from FlashFolderFARR to FlashFolder, taken away the DefaultSearchText-option... what else can I try? Reinstalling FARR?
« Last Edit: September 10, 2007, 06:00:49 AM by jzippo »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,435
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Dialog extension with FlashFolder and FARR2
« Reply #7 on: September 10, 2007, 05:43:32 AM »
sorry you must put your alias subdirectory inside one of the 2 aliases.  For normal users they should put it in the "AliasGroups\Installed\" directory.  For you, the author, you could put it in "AliasGroups\MyCustom\" so that you can edit it.

the reason for these two different alias directories is to distinguish alias files that should be updated on install or upgrade, and alias files that the user may customize and so should NOT be updated automatically.

jzippo

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 26
    • View Profile
    • Donate to Member
Re: Dialog extension with FlashFolder and FARR2
« Reply #8 on: September 10, 2007, 05:58:55 AM »
Ok, that works so much better :)

I was wondering about the dosearch thing, is there any option that would make it list the favorites the way  that FARR does before one starts to type search terms?


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,435
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Dialog extension with FlashFolder and FARR2
« Reply #9 on: September 10, 2007, 06:01:00 AM »
thats a very good idea.. i will add that.