1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CD with a "browser GUI"

Discussion in 'T&T - Aliases' started by MaartenG, Sep 9, 2016.

  1. MaartenG

    Joined:
    Aug 3, 2016
    Messages:
    355
    Likes Received:
    8
    In a previous millennium I used an alias to change directories with a @select-box:

    XX=(DIR/ad/km|set w=%@SUBSTR[%@select[con,1,30,23,75,Huidige dir: %_CWD ],0,12]^iff %w=. then^x^else^cd %w^XX^endiff)

    In the years in between someone, somewhere decided that - amongst other things - 640k was no longer enough, we needed longer than 8.3 filenames, the DIR layout had to change... the list goes on.
    Long story short: this alias is now in a very defunct state.

    But as I liked the possibility to change directories "interactive", I decided to bring it to the 21st century.

    It opens a SELECT-box through which you can "browse" until you reach your destination.
    [Enter] on the current directory (".") or [Esc] brings you back to the prompt in the new directory.
    You can give it a start-directory (any CDD parameter will do), but if you don't, it wil start in the current directory.

    Code:
    alias XX=`CDD %1 & TITLE %CD% & select /1 /a:d-l ("%CD%\") & if "%CD%" ne "%CURDIR%" (set CURDIR=%CD%& XX)`
    
    Edit this is a recursive alias: it calls itself.
    So, if you want to give it a different name (which you probably will), don't forget to replace the XX at the end of the alias.
    I know there is now @GETDIR and @GETFOLDER to select a directory (you could even use alias XX=`%@GETDIR[.]` to get the job done), but I don't like the fact that it's not very user-friendly without a mouse.
    Maybe there are other options, but this has to do for now.
     
    #1 MaartenG, Sep 9, 2016
    Last edited: Sep 9, 2016
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    What's mouse-unfriendly about @GETDIR?
     
  3. MaartenG

    Joined:
    Aug 3, 2016
    Messages:
    355
    Likes Received:
    8
    Nothing wrong if you use a mouse. Trouble starts if you DON'T use a mouse..
    ("Don't ... Not ... Without ... Note to self: never use triple negation again :-)

    For example: You have to [Tab] your way around.
    [Tab][Enter] to go one level up; [Tab][Tab][Tab](cursor keys) [Enter] to go one level down.
    Other keyboard shortcuts (Alt-Up, Backspace,...) are OS dependant.

    I don't like it. BTW: I prefer the keyboard anyway :-)

    Maybe you could test the alias to "feel" the difference?
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    Sorry, I read it wrong. I see what you mean.
     
  5. MaartenG

    Joined:
    Aug 3, 2016
    Messages:
    355
    Likes Received:
    8
    Well, English isn't my native language (or second language), so I assumed (and will continue to do so) it was my mistake.
     
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    No, it was truly my mistake. You said
    (which is perfect) and I read "with".
     

Share This Page