MDBU idea/how-to/request

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
JLoftus
Posts: 600
Joined: 22 Jan 2014 14:58

MDBU idea/how-to/request

Post by JLoftus »

I have an interesting idea for a MDBU feature... for a folder

I could see several neat potentials for a MDBU operation on a folder (currently does nothing, right?)

I would like to do this (maybe someone has a script idea, did not want to double-post):

MDBU on a folder could preview a text file within the folder of the same name. That is, if a folder named "InterestingIdeas" has a file in it named "InterestingIdeas.txt" then the MDBU would pop up a preview of that text file.

What do you think?

highend
Posts: 14993
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MDBU idea/how-to/request

Post by highend »

Could be done with a script + an .ahk .exe

A bit too specific for a general MDBU function imho...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66631
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: MDBU idea/how-to/request

Post by admin »

Yes, IMHOTOO. :) (Sounds like some pharaoh)

JLoftus
Posts: 600
Joined: 22 Jan 2014 14:58

Re: MDBU idea/how-to/request

Post by JLoftus »

OK, so that idea was too specific, are there any general things that are or can be done with MDBU on a folder?

highend
Posts: 14993
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MDBU idea/how-to/request

Post by highend »

Not atm...

Regarding your "wish"...

XYscript (put it on a hotkey, button, whatever):
Replace the
D:\PreviewTxtFile.exe

with whereever you place the .exe from the .zip file (attachment)!

Code: Select all

    if (exists("<curitem>") == 2) {
        $folderName = regexreplace("<curitem>", "^(.*\\)(.*?)$", "$2");
        $fileToPreview = "<curitem>\$folderName.txt";
        if (exists($fileToPreview) == 1) {
            run """D:\PreviewTxtFile.exe"" ""$fileToPreview""", "<curpath>";
        }
    }
When you execute the script, a white window (no top bar, no scroll bars, etc.), a little bit smaller than your XY instance opens up and shows the .txt file...
Click the left mouse button anywhere to close it...


Attachment: Compiled .ahk code...
PreviewTxtFile.zip
To see the attached files, you need to log into the forum.
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1888
Joined: 13 Jan 2011 19:44

Re: MDBU idea/how-to/request

Post by eil »

em.. why everybody forgot that in Thumbs view with folder thumbs enabled, MDBU on folder will popup folder's picture..
Win 7 SP1 x64 100% 1366x768|1900x1080

highend
Posts: 14993
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MDBU idea/how-to/request

Post by highend »

em.. why everybody forgot that in Thumbs view with folder thumbs enabled, MDBU on folder will popup folder's picture.
And what does the OP do, when his .txt file in that folder changes and he forgets to take a new screenshot from it? Preview outdated data?
Just askin' :ninja:
One of my scripts helped you out? Please donate via Paypal

JLoftus
Posts: 600
Joined: 22 Jan 2014 14:58

Re: MDBU idea/how-to/request

Post by JLoftus »

@highend, this worked great, thank you! would you mind sharing the ahk source? Also, I made this actionable from a CTB but really, would prefer MDBU, is there any way to associate that script snippet with MDBU (on a folder only) ?

Thank you again!

highend
Posts: 14993
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MDBU idea/how-to/request

Post by highend »

Code: Select all

#NoEnv
#SingleInstance, Force
#NoTrayIcon
#Persistent

WinGetPos, xPos, yPos, width, height, ahk_class ThunderRT6FormDC

xPos   += 5
yPos   += 30
width  -= 10
height -= 35

Gui, New, +LastFound +AlwaysOnTop +HwndPreviewHWND
Gui, Color, FFFFFF
Gui -Caption
Gui, Font, s10, Segoe UI

Gui, Add, Edit, x%xPos% y%yPos% w%width% h%height% -WantCtrlA -Wrap -VScroll -E0x200 BackgroundTrans Disabled ReadOnly
FileRead, FileContents, %1%
GuiControl,, Edit1, %FileContents%


Gui, Show, x%xPos% y%yPos% w%width% h%height%
return

GuiEscape:
GuiClose:
	ExitApp
return

LButton::
	ExitApp
return
As an external MDBU, yeah possible, but it requires a lot more work... As an internal one? Not with scripting.
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4468
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: MDBU idea/how-to/request

Post by klownboy »

If you install Thumbnail Extensions 1.03 (text file thumbnails in explorer) on your system you'll have thumbnails of any text type file including XYS scripts. The Control Panel applet lets you choose the extensions you'd like to see as thumbnails. You can then refer to the txt file in a desktop.ini in the folder (yes, refer to a text file) and then have the folder in the parent folder look like a txt file.
parent folder view.JPG
The desktop ini file simply refers to any text file and look something like this:

Code: Select all

[ViewState]
Mode=
Vid=
FolderType=Pictures
Logo=G:\Downloads\GroceryList.txt
Yes, it's a stupid example but it works. I wasn't able to get the text file like Grocery List.txt renamed to folder.txt to work directly but there may be a way around that as well. Of course this method doesn't really blow anything up when you MDBU on th folder since there is a limit to the text thumbnail size.
To see the attached files, you need to log into the forum.

highend
Posts: 14993
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MDBU idea/how-to/request

Post by highend »

Btw, when you remove the -VScroll option in the .ahk code, you can even scroll your "previewed" text vertically while there is no vertical scroll bar displayed...

And if you have any problems with wrong encodings (e.g. "Umlauts" in german), add:
FileEncoding, UTF-8

before:
FileRead, FileContents, %1%
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1888
Joined: 13 Jan 2011 19:44

Re: MDBU idea/how-to/request

Post by eil »

highend wrote:
em.. why everybody forgot that in Thumbs view with folder thumbs enabled, MDBU on folder will popup folder's picture.
And what does the OP do, when his .txt file in that folder changes and he forgets to take a new screenshot from it? Preview outdated data?
Just askin' :ninja:
i was only referring to statement that "MDBU on folder has no action" -it has.
Win 7 SP1 x64 100% 1366x768|1900x1080

Post Reply