This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) Printable version
View previous topic :: View next topic  
Author Message
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Sat Nov 03, 2012 5:57 am    Post subject: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline Reply with quote

Hi,

as I personally don't need all the functionality of F4Menu and because I needed Drag&Drop support opening of files to avoid multiple instances of my old graphics program I've written a minimalistic clone of F4Menu in AutoHotkey.

Introduction

F4 is the shortcut key used in Total Commander for opening selected files in a pre-defined program.
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:

- ChoiceEditor, http://www.totalcmd.net/plugring/ChoiceEditor.html
- Open File shell for TC, http://www.totalcmd.net/plugring/OpenFileTC.html
- Total Commander Edit Redirector, http://ghisler.ch/board/viewtopic.php?t=27573
- and of course the original F4Menu, http://ghisler.ch/board/viewtopic.php?t=17003 (original download links offline, see the thread for backup links)

While the original F4Menu has quite a few options, this minimalistic "clone" only has the
basic functionality: opening multiple file types in various programs.

One additional feature is that it can open selected files using a "Drag & Drop" method (a personal requirement). As of v0.5 it also has "Filelist" support.

v0.9 (June 16th 2016) - wildcard support and included INI version for those who prefer to store settings in INI format.

v0.94b (January 14th 2017) - added 4th method: cmdline

Instructions, Source, Screenshots & Download:

AutoHotkey 1.1+ (Ansi and Unicode)
https://github.com/hi5/F4MiniMenu
(just click on the ZIP link to download all files and unpack)

Simply run the script and it will use the F4 hotkey, you can exit the script via the tray icon, right click, exit.

Edit July 1st 2013: Unicode now works, fixed some other issues
Edit Mar 30th 2013: removed unicode branch + added filelist info
Edit Dec 15th 2012: rewrote entire post
_________________
https://github.com/hi5/F4MiniMenu


Last edited by hi5 on Sat Jan 14, 2017 6:45 am; edited 11 times in total
Back to top
View user's profile Send private message Visit poster's website
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Sun Nov 25, 2012 7:39 am    Post subject: Reply with quote

A new version is available with userfriendly guis. There are now also screenshots at the GitHub page.

edit: after this post posting links was allowed, so see first post or signature Very Happy
_________________
https://github.com/hi5/F4MiniMenu
Back to top
View user's profile Send private message Visit poster's website
LonerD
Senior Member
Senior Member


Joined: 19 Jun 2010
Posts: 278
Location: Donetsk

PostPosted: Mon Dec 03, 2012 4:34 pm    Post subject: Reply with quote

Thanks.
Great work.
But the configuration file in xml is complicated.
It would be more convenient in ini format.
_________________
Total Commander DreamLair - dream always, think totally, be the commander of you own life.
Windows 10 x64 SL English | Total Commander DreamLair pack v2017pre-α (9.0β x32+x64) | AkelPad Lair pack v2017 pre-β (4.9.8 x86)
Back to top
View user's profile Send private message
Balderstrom
Power Member
Power Member


Joined: 11 Oct 2005
Posts: 2146

PostPosted: Mon Dec 03, 2012 4:53 pm    Post subject: Reply with quote

That and AHK has built in functions for handling/parsing/writing INI files.

Question? Why use "ANSI" ... if you are going to continue development of such a tool, I'd recommend switching to Unicode AHK_L -- if yer not using manual memory allocation you wont see much (if any) difference between the ANSI and Unicode AHK binaries.
_________________
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
Back to top
View user's profile Send private message Send e-mail
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Thu Dec 06, 2012 12:42 pm    Post subject: Reply with quote

Hi,

thanks for the feedback.

LonerD wrote:
Thanks.
Great work.
But the configuration file in xml is complicated.
It would be more convenient in ini format.


As I make use of AHK 1.1+ Object's capabilities saving and loading settings as XML is just one command which makes it very easy for me to use.

With the v0.4 version of the script there is no particular need to edit the XML file manually as all settings can be changed via user friendly Gui's - you can see the screenshots on the GitHub page here https://github.com/hi5/F4MiniMenu#screenshots
(Settings available via the tray menu)

Balderstrom wrote:
That and AHK has built in functions for handling/parsing/writing INI files.


True (IniRead/IniWrite/IniDelete), but they are also tedious to use if you want to read/store many variables even if you use Loops and some other tricks.
However, I did see some Ini <-> Object functions/libraries so I will look into that to see if they are as easy to use as the current XA library I'm using and I might switch.

Balderstrom wrote:
Question? Why use "ANSI" ... if you are going to continue development of such a tool, I'd recommend switching to Unicode AHK_L -- if yer not using manual memory allocation you wont see much (if any) difference between the ANSI and Unicode AHK binaries.


I use ANSI because of the Drag & Drop function I currently use. That only works with AHK Ansi I'm afraid due to the DLL Call / NumPut functions it uses (they don't work in Unicode)
I did find a Unicode version but haven't been able to get it to work yet.

Ideally I would use one function for both the Ansi and Unicode versions of AHK and will keep looking into it.
(I'm not an experienced programmer so I have to use "advanced" functions as I find them).

I'll post here about any significant updates, see also the TODO list https://github.com/hi5/F4MiniMenu#todo---known-issues (below that you will the links to function I used as well)
_________________
https://github.com/hi5/F4MiniMenu
Back to top
View user's profile Send private message Visit poster's website
Balderstrom
Power Member
Power Member


Joined: 11 Oct 2005
Posts: 2146

PostPosted: Thu Dec 06, 2012 1:18 pm    Post subject: Reply with quote

hi5 wrote:

Balderstrom wrote:
That and AHK has built in functions for handling/parsing/writing INI files.


True (IniRead/IniWrite/IniDelete), but they are also tedious to use if you want to read/store many variables even if you use Loops and some other tricks.
However, I did see some Ini <-> Object functions/libraries so I will look into that to see if they are as easy to use as the current XA library I'm using and I might switch.


I haven't found that to be the case ...

Here are the functions I use for reading/writing from/to TC's wincmd.ini
Code:
TC_CheckINIRedirect( iniSection, wincmd )
{
   if(!wincmd)
      EnvGet, wincmd, COMMANDER_INI
   iniRead, iniRedirect, %wincmd%, %iniSection%, RedirectSection, %wincmd%
   SplitPath, iniRedirect, iniFile, iniPath
   if( !iniPath )
      SplitPath, wincmd, tmpFile, iniPath
return iniPath "\" iniFile
}

TC_iniRead( iniSection, iniKey, wincmd="" )
{
   iniFile := TC_CheckINIRedirect( iniSection, wincmd )
   IniRead, keyValue, %iniFile%, %iniSection%, %iniKey%, %A_Space%
return keyValue
}

TC_iniWrite( value, iniSection, iniKey, wincmd="" )
{
   iniFile := TC_CheckINIRedirect( iniSection, wincmd )
   IniWrite, %value%, %iniFile%, %iniSection%, %iniKey%
return
}   

So you would be dealing with your own .ini, and not need to worry about things like redirection of the given section.
Code:

F4MM_iniWrite( value, iniSection, iniKey, iniFile="F4MiniMenu.ini" )
{
   IniRead, keyValue, %iniFile%, %iniSection%, %iniKey%, %A_Space%
return keyValue
}

F4MM_iniRead( iniSection, iniKey, iniFile="F4MiniMenu.ini" )
{
   IniWrite, %value%, %iniFile%, %iniSection%, %iniKey%
}

F4MM_INIT(iniFile="F4MiniMenu.ini")
{
   Global
   local configVars:="foo,bar,baz,foz" ; variables under [Config]
   local gVarName

   Loop, Parse, configVars, `,
   {
      gVarName:="F4MM_" A_LoopField
      %gVarName%:=F4MM_iniRead( "Config", A_LoopField )

   }
}


Working Example, using a fake F4MM_iniReadExample function to show input/output.
Code:
F4MM_INIT()
F4MM_ShowVars()
return

F4MM_iniReadExample( iniSection, iniKey )
{
   random, rand, 1,10
   return "example" rand "_" iniKey
}

F4MM_INIT(iniFile="F4MiniMenu.ini")
{
   Global
   local configVars:="foo,bar,baz,foz" ; variables under [Config]
   local gVarName

   Loop, Parse, configVars, `,
   {
      gVarName:="F4MM_" A_LoopField
      %gVarName%:=F4MM_iniReadExample( "Config", A_LoopField )
   }
}

F4MM_ShowVars()
{
   Global

   local configVars:="foo,bar,baz,foz" ; variables under [Config]
   local tmpV

   Loop, Parse, configVars, `,
   {
      tmpV:="F4MM_" A_LoopField
      MsgBox, % tmpV ":: " %tmpV%
   }
}
Back to top
View user's profile Send private message Send e-mail
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Thu Dec 06, 2012 2:10 pm    Post subject: Reply with quote

Thanks for the example, and I know there are INI libraries (not using Objects) on the AHK forum as well (which I didn't like) but I still think it is "too much" work compared to these two very simple commands:
XA_Load() and XA_Save().
That is all I need to do and I have ALL my variables available after one command, or the updated variables saved via one command.
But I don't think INI vs XML is an issue suitable/useful for discussion here or that it would impact usability of the script.
Unicode would be the biggest puzzle to solve, the rest is just window dressing Wink

Edit: re ini-object this oINI library seems useful http://www.autohotkey.com/board/topic/71982-library-oini-ini-object/ ... will investigate further.
_________________
https://github.com/hi5/F4MiniMenu
Back to top
View user's profile Send private message Visit poster's website
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Sat Dec 15, 2012 4:58 am    Post subject: Reply with quote

Experimental branch with Unicode support for the Drag & Drop function, download the ZIP here https://github.com/hi5/F4MiniMenu/tree/UnicodeDD

Feedback welcome.

Also: Started experimenting with INI config but not satisfied with results yet.
_________________
https://github.com/hi5/F4MiniMenu
Back to top
View user's profile Send private message Visit poster's website
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Sat Mar 30, 2013 3:11 am    Post subject: Reply with quote

Update v0.5
- remove Unicode branch (wasn't working at all)
- added new Filelist support similar to the %L in button bar/start menu so you can pass on a file with the selected files to a program. Example usages are WinAmp (playlist) and XnView (view selected files in image browser)

More info and download (ZIP file) at https://github.com/hi5/F4MiniMenu
_________________
https://github.com/hi5/F4MiniMenu
Back to top
View user's profile Send private message Visit poster's website
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Mon Jul 01, 2013 10:13 am    Post subject: Reply with quote

Update v.06:
- Now works with AHK 1.1+ Unicode as well (drag & drop)
- Fixed listview icon issue

More info and download (ZIP file) at https://github.com/hi5/F4MiniMenu
_________________
https://github.com/hi5/F4MiniMenu
Back to top
View user's profile Send private message Visit poster's website
LonerD
Senior Member
Senior Member


Joined: 19 Jun 2010
Posts: 278
Location: Donetsk

PostPosted: Mon Oct 21, 2013 6:19 pm    Post subject: Reply with quote

Bug command:
"Gui, Browse:Destroy"
F4MiniMenu can't work probably with it in TC 8.50 betas under Win8 x64 Eng
_________________
Total Commander DreamLair - dream always, think totally, be the commander of you own life.
Windows 10 x64 SL English | Total Commander DreamLair pack v2017pre-α (9.0β x32+x64) | AkelPad Lair pack v2017 pre-β (4.9.8 x86)
Back to top
View user's profile Send private message
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Tue Oct 22, 2013 3:10 pm    Post subject: Reply with quote

Thanks for the feedback, I don't have Win8 or 64bit but I'll try to prepare another version moving the Gui code around and avoiding Destroy but use Show & Hide. Might take a few weeks but I'll post link to GH branch here...
Back to top
View user's profile Send private message Visit poster's website
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Tue Nov 05, 2013 12:46 pm    Post subject: Reply with quote

@LonerD: I'm now running Win8.1 64bit Eng with TC 8.50beta7 (64 bit) and I can add, modify and remove editors without any problems. Can you tell me a bit more so I can try replicate the error? When you get the error messages, does it say in which include (settings.ahk or editors.ahk) or line the error occurs (Gui, Browse:Destroy is used in these two includes)

I'm running AHK 64bit (unicode) 1.1.13.01 and F4MiniMenu v0.61.
Back to top
View user's profile Send private message Visit poster's website
hi5
Member
Member


Joined: 03 Nov 2012
Posts: 115

PostPosted: Fri Nov 07, 2014 5:50 pm    Post subject: Reply with quote

F4MiniMenu - 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.
Arrow Download the ZIP file https://github.com/hi5/F4MiniMenu (simply unpack and run) - don't forget to backup your F4MiniMenu.xml just to be sure.
_________________
https://github.com/hi5/F4MiniMenu
Back to top
View user's profile Send private message Visit poster's website
LonerD
Senior Member
Senior Member


Joined: 19 Jun 2010
Posts: 278
Location: Donetsk

PostPosted: Tue Feb 09, 2016 2:16 pm    Post subject: Reply with quote

Hi. Still only xml support?
_________________
Total Commander DreamLair - dream always, think totally, be the commander of you own life.
Windows 10 x64 SL English | Total Commander DreamLair pack v2017pre-α (9.0β x32+x64) | AkelPad Lair pack v2017 pre-β (4.9.8 x86)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) All times are GMT - 6 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group