Coder Social home page Coder Social logo

f4minimenu's Introduction

F4MiniMenu - v0.92

A minimalistic clone of the F4Menu program for Total Commander (open selected files in editor(s)) just offering the basic functionality. Original F4Menu program by Shao Shanny - www.shanny.com.cn (website seems to be offline, see TC forum links below)

If you have any questions or suggestions do feel free to post them at the F4MiniMenu TC Forum thread.

Introduction

F4 is the shortcut key used in Total Commander - a file manager for Windows - for opening selected files in a pre-defined editor. In TC only one program can be assigned to F4 making it impossible to define or select other editors for different file types. Several tools have been made to solve this problem, these include:

While the original F4Menu has quite a few options, this minimalistic "clone" only has the basic functionality: opening multiple file types in various editors. An additional feature is that it can open selected files using a "Drag & Drop" method (a personal requirement) or by preparing a Filelist.

First come, first serve

F4MiniMenu will open a file in the first editor it can find a match for based on the extension. If it can not find a match it will open the file(s) in the default editor. The default editor is the first editor listed in the Configure editors window. If you look in the configuration XML it will be the first editor there. If you want to open the file(s) in another program you can use the Foreground menu option. see below.

Tip(s)

In principle you can run F4Menu and F4MiniMenu side by side as long as you do not use conflicting keyboard shortcuts. If you use same hotkey setup, F4MiniMenu will take precedence. You can set the F4MiniMenu shortcuts via the tray menu, right click, Settings option.

In general: be careful opening with opening large numbers of files at once, programs can crash and your computer could become unstable requiring a reboot.

Do not edit the "F4MiniMenu.xml" or "F4MiniMenu.ini" settings file while the script is running, any changes you make will be overwritten when the script exits. As of v0.61 a backup is made at startup and saved as "F4MiniMenu.xml.bak" or "F4MiniMenu.ini.bak"

Disclaimer

Use at your own risk.

Drag & Drop support

Many programs support Drag & Drop, but not all programs will respond well to the Drag & Drop method used in this script, so if it does not seem to work with a particular program, try the Normal method.

Filelist support

Some programs allow you to open files which are listed in a (temporary) file. In Total Commander you can use something similar in the Button bar and in the Start Menu where you can use the %L parameter to create a list file with the names of the selected files and directories, one file per line. F4MiniMenu can do the same. If you use this method a temporary file named $$f4mtmplist$$.m3u is created which is passed on to the target program.

Example Filelist usage:

Program: C:\Program Files\XnView\xnview.exe
Parameters: -filelist
Method: 3 - Filelist

Result: Selected files will now be opened in the XnView browser.

Notes:

  • The reason for the .m3u extension is simple: it enables playlist support for WinAmp: Select multiple music files and press the hotkey to play the selected files. If the temporary file didn't have the .m3u extension WinAmp wouldn't recognize it as a playlist.
  • The temporary file $$f4mtmplist$$.m3u is not deleted directly after use to avoid problems with slow programs. It is deleted when F4MiniMenu starts or closes.

Setup

Requirements

  • AutoHotkey 1.1+ (Ansi or Unicode)
  • Total Commander

Install

Script

Download the source as a ZIP from GitHub here https://github.com/hi5/F4MiniMenu/archive/master.zip and unpack. To start it simply run F4MiniMenu.ahk. You can now setup F4MiniMenu using the tray menu options for Settings and Configure editors.

Once you have setup your shortcuts you can also access Settings and Configure editors via the Foreground menu options by pressing the shortcut (press Esc+F4 by default). See screenshots below.

There are two versions:

  1. F4MiniMenu.ahk uses XML to store settings (F4MiniMenu.xml)
  2. F4MiniMenui.ahk uses INI to store settings (F4MiniMenu.ini)

Executable

If you wish you can compile the script to a standalone executable using AHK2Exe

Screenshots

Foreground menu

Foreground menu

Confirm maximum

Confirm maximum

General program settings

General program settings

Configure editors

General program settings

Editor configuration

Editor configuration

TODO - Known issues

  1. TOFIX: If you change the order of the editors first and then add a new one, the order is set back to the initial order.
    2. INFO: Delay (in milliseconds) is only applicable to Drag & Drop method.
  2. INFO: Two options for delay (as of v0.9):
    2.1 Drag & Drop delay gives program to start up before trying to drop the files - you may need to apply trail and error.
    2.2 Open delay, pauses X ms to open next file.
  3. TODO: Change from standalone setup (as it currently is) to #include mode, which will make it easier to #include it in a "always" running AHK script.

Benefits

  • Open source - written in AutoHotkey
  • Supports Drag & Drop (for AutoHotkey 1.1+ Ansi and Unicode)
  • Supports Filelist method (Similar to %L in TC) as of v0.5

Credits

Used AHK Functions & Libraries

Original idea

Changelog

  • 20160618 - v0.92 Fix error checking on startup in case script is compiled - HT Ovg
  • 20160618 - v0.91 Fix for INI Editors include (save to INI not XML when making backup). Refinement of regulars expression for wildcards - HT Ovg
  • 20160618 - v0.9 Added support for wildcards (? and *) in extensions #6 hi5#6. Added open delay (delay in ms between opening files)
  • 20160617 - v0.83 Adding specific #include path for lib files to avoid possible error for portable users when compiling. HT Ovg
  • 20151104 - v0.82 Further refinement of confusing error message at very first startup (missing configuration XML) - now also checks if BAK is present.
  • 20151103 - v0.81 Fixed confusing error message at very first startup (missing configuration XML)
  • 20141107 - v0.8 Added F4 functions to Lister (grabbing the filename from the Window title) and the search results in the Find Files dialog. Comment: if you use the Esc & Key as Foreground menu option it will fail as pressing Esc will close Lister and the Find Files dialog. The Winkey & Key combination does work - the menu will appear at the top of the window.
  • 20140806 - v0.7 replaced Loop, object.MaxIndex() with proper for-loop to parse each key-value pair in the MatchList object; Added &letter to foreground menu options (program names)
  • 20130731 - v0.61 added rudimentary backup & safety feature in case of a faulty/missing settings XML
  • 20130701 - v0.6 a) Class LV_Rows by Pulover replaces LV_MoveRow(). This resolves the problem with the listview not updating icons while moving the editors in the settings Gui; b) Added Unicode support for drag & drop method so F4MiniMenu should now be compatible with both Ansi and Unicode versions of AutoHotkey.
  • 20130607 - v0.51 Check if selected file(s) are archived, if so bypass F4MiniMenu all together and use internal TC Edit command to open file, this will only use the file under the cursor, not all selected files.
  • 20130330 - v0.5 a) Process entire file list first and open per program; b) Introduced Filelist method; c) Removed "Open Mode".
  • 20121117 - v0.4 Configuration GUIs, tray menu. First editor now considered default editor.
  • 20121111 - v0.3 Added menu for "foreground" feature - open all selected files with specific editor (its behaviour may change in future).
  • 20121108 - v0.2 Added 0 (zero) entry in XML as default editor.
  • 20121101 - v0.1 Initial very basic version.

f4minimenu's People

Contributors

hi5 avatar

Watchers

soda avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.