Is it possible to do some calculations in custom columns?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Wojtek
Junior Member
Junior Member
Posts: 65
Joined: 2010-02-07, 11:58 UTC
Location: Germany

Is it possible to do some calculations in custom columns?

Post by *Wojtek »

Is it possible to do some calculations in custom columns?

Or is there any other way or plugin to achieve the following:

File => image.jpg => width = 4000, height = 3000 [pixels]
Custom Column => Aspect Ratio => ratio = width/height = 1.333
Custom Column => Megapixels => mp = (width*height)/1000000 = 12 => mp + " MP" = 12 MP

File => audio.mp3 => length = 225 [seconds]
Custom Column => Duration => min = (length/60) - (length/60) MOD 1 = 3; sec = length MOD 60 = 45 => duration = min + " min " + sec + " sec" = 3 min 45 sec
Asus Maximus VIII Hero · Win10 Pro x64
Crucial MX500 1TB SSD · 64GB Corsair Vengeance LPX · nVidia GeForce RTX 3060 · Intel i7 7700K

Lenovo ThinkPad X1 Yoga 2.Gen · Win10 Pro x64
512GB SSD · 16GB RAM · intel HD620 · i7-7600U

TC 11.02 32-bit #347308
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: calculations in custom columns

Post by *Hacker »

Wojtek,
Nope. You'd have to find a plugin that does provide these values directly.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Wojtek
Junior Member
Junior Member
Posts: 65
Joined: 2010-02-07, 11:58 UTC
Location: Germany

Re: calculations in custom columns

Post by *Wojtek »

Hacker wrote: 2020-03-29, 12:21 UTC Wojtek,
Nope. You'd have to find a plugin that does provide these values directly.

Roman
D'Oh! :(

I already searched all content plugins on totalcmd.net, but didn't find anything that suits my needs.

Is it difficult to build own plugins? I have some basic knowledge of JS, PHP, VBA, VBS, and JAVA, but I have absolutely no experience in developing.


Can I use any of these* plugins (listed below) to get the job done (the calculations I mentioned above)?

*)
Asus Maximus VIII Hero · Win10 Pro x64
Crucial MX500 1TB SSD · 64GB Corsair Vengeance LPX · nVidia GeForce RTX 3060 · Intel i7 7700K

Lenovo ThinkPad X1 Yoga 2.Gen · Win10 Pro x64
512GB SSD · 16GB RAM · intel HD620 · i7-7600U

TC 11.02 32-bit #347308
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: calculations in custom columns

Post by *Hacker »

Wojtek,
Yup, at least with AutoHotkey it was quite easy.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
tuska
Power Member
Power Member
Posts: 3760
Joined: 2007-05-21, 12:17 UTC

Re: calculations in custom columns

Post by *tuska »

WinScript Advanced 1.7
Here is a solution how to integrate an AHK script via a plugin into a 'custom columns view'.
But I'm not a developer, so I may not be able to answer questions about this topic.
Thany
Senior Member
Senior Member
Posts: 292
Joined: 2003-09-30, 09:20 UTC
Location: Netherlands

Re: Is it possible to do some calculations in custom columns?

Post by *Thany »

Sorry to kick an old topic, but I was wondering if this has been implemented by now, now that it's 3.5 years later.

It seems like basic calculations should probably be available...
Or if not, should find their way onto ghisler's todo list :)
Total Commander 11 on Windows 10
Fla$her
Power Member
Power Member
Posts: 2317
Joined: 2020-01-18, 04:03 UTC

Re: Is it possible to do some calculations in custom columns?

Post by *Fla$her »

2Thany
No. There is no math in the columns, and in general, given that simpler things are not realized, this one has even less chance.
As for the starting query, there are such options
  • for the aspect ratio: [=imgsize.Aspect Ratio], [=wdx4i.aspect], [=wdx4i.fdocasp]
  • for megapixels, only a script on WSAP.
  • for mp3 duration: [=mp3info.Length.s], [=anytag.Length.s], [=tcmediainfo.Duration.s], [=tcmediainfo.Duration.Custom]
If you need something specific, describe it. We will help you write code for WSAP.
Overquoting is evil! 👎
Post Reply