Feature Request - Smart EDIT

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

pj
Gold Member
Gold Member
Posts: 475
Joined: 2006 Jan 26, 14:01
Location: Florida

Feature Request - Smart EDIT

Post by pj »

Currently in x2 only ONE editor can be set up to run when F4 selected. If that's not the correct editor for the selected file(s), then the user has to use other less convenient means to open the desired editor and then open the file(s) from within the editor or via drag and drop.

This seems very weak for a top-of-the-line file MANAGER.

Proposal: Add SMART editor launch that will use multiple layers of information to select the editor the user desires to open:
  • First layer: A new "Editor Assignment" dialog in x2 to set up editors, and the command line prototype, by extension.
  • Second layer: Use the Windows-defined EDIT verb, which may not be the default action for this file type, to open the file with the desired editor.
  • Last chance layer: When the above fail, open the file in the DEFAULT editor, which can be set up in the "Editor Assignment" dialog by checking a box beside the editor to use as the default.
We know ENTER is always set in Windows to open the file with the default verb, most often RUN. But power users like the x2 user base don't just USE files, they CREATE, EDIT and MAINTAIN those files, and many different types of files. One editor does NOT fit all! This eliminates all those user commands and toolbar buttons that people have been stuck with, and the limitations of using them, and consolidates the edit function to a single keystroke, no matter what the file type is.

What's not to like about this needed functionality? This can be extended to the BROWSE function (F3), but the generic editor2 seems to meet most of my browsing needs. Editors are a different story!

OK, let's shoot holes in this idea or let me know if you agree this is a feature you'd like to see.

--------------------------------
PJ in FL
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Feature Request - Smart EDIT

Post by Kilmatead »

pj wrote:OK, let's shoot holes in this idea...
Considering that the Tools -> Options -> Editor setup can be set to point to any EXE programme (not just editors), what's stopping you from writing a script which delegates all the decisional logic you just explained? Then, when you hit <F4> the selected arguments are automatically passed to your own bespoke decision-making tree, parsed, and launched accordingly in the requisite editor(s). This way you don't have to send 39.4 emails back and forth to Nikos explaining why every implementation he attempts is somehow wrong in that special "nikosian" way...

Surely a rocket-scientist such as yourself could do that, no? Or were you the one responsible for the Hubble's first mirror? :wink:
pj
Gold Member
Gold Member
Posts: 475
Joined: 2006 Jan 26, 14:01
Location: Florida

Re: Feature Request - Smart EDIT

Post by pj »

Unfortunately launch schedules are VERY fixed, so time isn't on my side (isn't there a song about that?).

And anyway, you're the script guy. I'd guess you'd even come up with a well-behaved GUI to go with it, if you had a moment free from testing TC add-ins.

However, I'd never take away the opportunity for Nikos to implement a game-changing feature like this into the next release and generate tons of cash from an adoring public.
---------------------------
PJ in FL
User avatar
nikos
Site Admin
Site Admin
Posts: 15793
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Feature Request - Smart EDIT

Post by nikos »

you can set your custome editor for F4 and then use CTRL+F4 to use x2's own editor (despite the external one)
for all other uses, right click + OPEN WITH
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Feature Request - Smart EDIT

Post by Kilmatead »

As all pretty girls know, if you string 'em along a bit longer before you summarily shut them down (instilling in them a lifelong emotional fear of rejection), you're going to get more compliments, diamonds, and trinkets "while it lasts".

Just sayin'. :wink:

(Think I heard that in a business-course I once audited sleepily.)
pj
Gold Member
Gold Member
Posts: 475
Joined: 2006 Jan 26, 14:01
Location: Florida

Re: Feature Request - Smart EDIT

Post by pj »

nikos wrote:you can set your custome editor for F4 and then use CTRL+F4 to use x2's own editor (despite the external one)
for all other uses, right click + OPEN WITH
Yep, I surely can -- but I DON'T WANT TO!!!

GET IT!

That is the POINT of the FEATURE REQUEST.

I have more than 2 editors, BECAUSE I EDIT MORE THAN 2 FILE TYPES. Programs of various languages, video, image, text, XML, HTML, Grandma's Recipes. Am I getting through?

The editor used for each is going to depend on the TYPE, and will be different for many types because editors are usually good at a single or a few types. Plus, my choice of the best editor for any or all of those may change tomorrow.

So I'd need to judge, pretty much on a daily basis, which I want to assign to F4, which to ctrl-F4, which to relegate to Open With, blah, blah, blah.

That is SO 200x thinking!

I want them ALL to open in an editor of my choice when I press F4.

F4 = EDIT. PERIOD.

THAT IS THE POINT, CRUX, PARADIGM, and CODA of this topic!

A simple DIALOG that assigns an editor to an extension. Open the file in the assigned editor with F4. Not right-click s...t. Not ctrl-F4.

Just F4.

Just "EDIT".

Think "EDIT" -> Press F4. Done. Don't think which key, which program, I already thought that out once and SET IT, now just DO IT!

Simple.

Easy.

I CAN THINK OF OTHER S...T INSTEAD OF WHAT KEY DOES NIKOS WANT ME TO USE FOR THE ALTERNATE EDITOR AND DOES THAT WORK FOR THE FILE TYPE I'M POINTING AT.

Oh, and if you celebrated Thanksgiving yesterday, hope you had a wonderful time. Be thankful!
-------------------------------
PJ in (crabby) FL
User avatar
nikos
Site Admin
Site Admin
Posts: 15793
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Feature Request - Smart EDIT

Post by nikos »

so how is this going to work, using magic or paranormal communication between man and machine?
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Re: Feature Request - Smart EDIT

Post by FrizzleFry »

here is a simple implementation in AutoHotkey

Code: Select all

;msgbox, %A_ScriptDir%
listfile=%A_ScriptDir%\ext-commands-list.txt

ifnotexist, %listfile%
{
	MsgBox,0,extensions-commands,Error: no extensions-commands list found!
	exitapp
}

if %1%
{
	;msgbox, %1%
	splitpath, 1, , , extension
	;msgbox, %extension%
}
else
{
	MsgBox,0,extensions-commands,Error: no file specified!
	exitapp
}

pattern=^%extension%=(.+)$
loop,read,%listfile%
{
	line=%A_LoopReadLine%
	if RegExMatch(A_LoopReadLine,pattern,match) > 0
	{
		run, %match1% "%1%"
		exitapp
	}
}

; default program defined as last line in list file
; default=D:\tools\AkelPad\AkelPad.exe

pattern=^default=(.+)$
if RegExMatch(line,pattern,match) > 0
{
	run, %match1% "%1%"
}
you need to compile the script and create a list of extensions with their associated commands named 'ext-commands-list.txt' which the scripts looks for in the folder it is located in...
this is the format of the list file... the default line needs to be at the end of the list...

Code: Select all

csv="D:\tools\CSV Viewer.exe"
jpg=D:\tools\IrfanView\i_view32.exe
default=D:\tools\AkelPad\AkelPad.exe
I started to do this as a if-if else-else structure but then you would have to recompile the script every time you want to add or adjust the commands.
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Feature Request - Smart EDIT

Post by Kilmatead »

Since life wouldn't be any fun without a little competition, here is a Kilmateadian variant:

Image
Image

Download: TemperTantrumEdit 42KB Version 0.0.0.5 (30-Nov-2015)

Just assign x2's <F4> editor to TTE.EXE and you're done. Well, yes, you need to define a few editors, and assign them some file-extensions to play with, but that's easily done via the usual GUI nonsense (run TTE without arguments for configuration).

If you try and "<F4> a file" which does not have an explicitly defined extension, it will try and open it with the shell's "Edit" verb (if the file has one - not all do). If it does not have one, TTE will open allowing you to assign an editor to it. Remember that the Edit-verb is distinct from the Open-verb, which for our purposes is never used. TTE will not create Edit-verbs, but acts rather more like an x2 midwife for them, if that makes any sense. :shrug:

If you want "one editor to rule them all" as a default to use even if the Edit-verb fails, include the text "<Default>" in the extension list of any editor. Bear in mind that this is a little silly because weird things can happen if you open an EXE in Notepad, etc, etc, etc - so applying a bit of common-sense could come in handy.

Short and sweet. :D There are still a few minor GUI niggles to iron-out, but this is more than functional as-is.

(The name and icon, in case you didn't guess, are a response to PJ's little rant. Civility and age progress by inverse proportions within his blood-line, apparently. :wink:)
Last edited by Kilmatead on 2015 Nov 30, 01:27, edited 1 time in total.
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Re: Feature Request - Smart EDIT

Post by FrizzleFry »

nice... for better or worse it has a similar look-and-feel as x2's configuration dialogs... and it should satisfy PJ's needs...
Enternal
Member
Member
Posts: 54
Joined: 2013 Aug 03, 05:28

Re: Feature Request - Smart EDIT

Post by Enternal »

Haha. This is a feature that XYplorer has for a very long time... but that's beside the point. Thanks to Kilmatead and FrizzleFry, xplorer2 can now do it too! Yeah!! I always wanted to ask to ask nikos for this function but always afraid he's going to shoot it down lol. Anyway, Kilmatead, is that wonderful tool written in AHK or AutoIt too? It looks so close to xplorer2's own interface so that's pretty cool (except it's quite airy with the padding but I like that). Seriously though, nikos, this would be a very nice feature.

Right after I typed the above, I looked at it and it's written in C... NO I'M NOT FAMILIAR ENOUGH WITH C :( . Anyways, the project has the extension of cbp? Code Blocks? What is the compiler? But seriously this is too cool... Way too cool... with this, I might actually be able to make this tool I wrote for XYplorer to function with xplorer2 too through this. I will have to test that out later. Since I'm here I might as well ask since I don't remember but does xplorer2 offer anyway you can obtain the path of pane 1 and pane 2 and then pass that as a parameter? I will need it to make it work with the tool I wrote.

Now I just need to deal with obsession of carrying multiple file managers around... I'm saving up to buy Total Commander soon. Why? Because I gotta. By then, I would have a license to xplorer2, XYplorer, and Total Commander. All I'm missing is Directory Opus and my file manager collection is complete for the good paid ones (though I'm also looking at Altap Salamander).
User avatar
nikos
Site Admin
Site Admin
Posts: 15793
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Feature Request - Smart EDIT

Post by nikos »

well done guys you have reinvented the wheel (shell). That's why filetypes have edit verbs in the registry so you don't need to have this duplicated in every program created. But now it is done!
Enternal
Member
Member
Posts: 54
Joined: 2013 Aug 03, 05:28

Re: Feature Request - Smart EDIT

Post by Enternal »

But but but!! But imagine this! You can use xplorer2 and in the settings, have all images (ext: bmp, gif, jpg, png) associated with the wonderful and sexy *Insert File Image Software*. Now whenever you take your sexy portable file manager to other computers or your evil aunt's house, you can browse her hidden image collection naturally with your favorite sexy image viewer the instant your start your sexy file manager without mucking with her computer's file association or taking a few more steps here and there to open up *Insert File Image Software* and then use it to view the images. Because who knows, she might have all her favorite pictures associated with textpad...

Besides, all the programs that I used so far have been smart about it. By default, you can open the files by using the shell's default file association. But when the needs arise, you can then choose a different program from a list that you personally setup. For example, I usually like to have Windows photo viewer as my default photo viewer. However there are times I want to crop an image. I can just my hotkey, a list comes out with additional image programs that I have associated with images, select FastStone MaxView, and then crop the image. Or I have another folder that I would like to view in a photo viewer with flair. Use my hotkey, select XlideIt. Boom photo viewing on steroids and fluffiness. I like being boring today and stick with the default file association, I double-click the image. Boom Windows default photo viewer. Still much better than going through Windows's own "Open with..." which sucks.
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Feature Request - Smart EDIT

Post by Kilmatead »

Enternal wrote:...the project has the extension of cbp? Code Blocks? What is the compiler?
Yeah, CodeBlocks is the IDE, but that's not really important - the source is tiny, relatively speaking; the project file is included just in case anyone wants to compile from scratch where the libraries are manually linked. The compiler is the TDM-GCC 64 branch of MinGW, but that too isn't important - the code is all just WinAPI so any setup could make it. :shrug:

You must have missed my Road to Damascus Moment. :wink:

I thought you were a PureBasic guy, no? With a real license all your own and everything.

I design GUI's to be "loose" (airy?) to make it easier to add options later (if necessary) without needing to move stuff around too much, as I don't cheat by using a resource-editor in design: it's all done manually by hand (and numbers). :D I also design in a higher-DPI so sometimes things look a little different when scaled down, but I try to test everything to make sure its voice doesn't change too much when you kick it in the gonads.
Enternal wrote:does xplorer2 offer anyway you can obtain the path of pane 1 and pane 2 and then pass that as a parameter?
Using the "$L" and "$R" tokens in user-commands give the pane-paths accordingly. The most difficult thing is usually determining the "active pane" if you need it, which pretty much all of my scripts have a reliable stock method of doing.
nikos wrote:you have reinvented the wheel (shell)
If people liked using the shell, they probably wouldn't use 3rd-party explorers. It is not the Wonderful Wizard of Oz extensible subsystem you like to pretend it is. (Well, ok, yes it is, but they don't look at it that way: to them it's the Zombie Apocalypse waiting to happen, and just as pretty and friendly as that sounds. As you well know from 7zNSE, every successive version of Windows makes truly useful programmes next to impossible to use.)
Enternal wrote:I'm saving up to buy Total Commander soon. Why? Because I gotta.
I think Nikos already took care of that, no?
pj
Gold Member
Gold Member
Posts: 475
Joined: 2006 Jan 26, 14:01
Location: Florida

Re: Feature Request - Smart EDIT

Post by pj »

Friz, K - What can I say but ...


"GREAT JOB GUYS!"

:wave: :party: :party: :beer: :beer: :beer: :party: :party: :wave:


Nikos - What can I say but "Meh?" :shrug:

Yes there is an EDIT verb, but it's not used much in most environments, and not relevant in a portable use world.

E hit the nail squarely on the head - x2 is very useful as a truly portable file manager, but can't really define it's environment between different machines due to it's lack of this type of configuration. Portable programs free me from the crap Windows forces on users when installation is required to set up all the ill-defined heaps and registries and hidden user folders....

A single working environment can be defined, loaded on a xxGB thumb drive, and carried to different machines as needed. I work on three computers every day, and can be as many as seven if people and networks (home) are acting up. And, no, I'm not an IT guy. But having a reliable environment available at each device, in spite of various OSs from XP and Vista to Heavenly Seven and Awful Eight is SO NICE! So far, I've avoided getting sucked into Terrible Ten.

------------------------------
PJ in (Nikos still doesn't "get it") FL
Post Reply