Custom column - count of times file opened?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Zonko
Posts: 10
Joined: 14 Jul 2017 16:14

Custom column - count of times file opened?

Post by Zonko »

I'd like to add an extra column that gives a count of the number of times I've opened / launched a file from XYPlorer. Similar to ITunes, where it shows the number of times a song has played, but instead tracks the time a file/video was opened.

Is this possible?

Of course, if the file is opened from vanilla explorer, no need to increment the count.

I see there is a built in column 'Date Accessed'. This would be a close second possibility, but I think this is a built in Windows and doesn't seem to work, anyway.

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

Re: Custom column - count of times file opened?

Post by highend »

E.g. use this as the first entry for the portable file associations

Code: Select all

*>::tagitems("ex1",tagitems("ex1",,<curitem>)+1,<curitem>);#485;#1053;
And this as the script for the custom column

Code: Select all

return tagitems("ex1", , <cc_item>);
If the list refresh is too much for you, remove the #485;
part but the counter would be one behind and to see
the correct value you'd need to refresh the list manually...
One of my scripts helped you out? Please donate via Paypal

Zonko
Posts: 10
Joined: 14 Jul 2017 16:14

Re: Custom column - count of times file opened?

Post by Zonko »

It worked! Many thanks.

I took out the #485 - it added latency when opening a file, I can live with the counts being delayed.

Zonko
Posts: 10
Joined: 14 Jul 2017 16:14

Re: Custom column - count of times file opened?

Post by Zonko »

One issue here - I've noticed this works if you open an item by double clicking, but if you use the context-menu (example : right-click-->Open with) it won't count. Imagine the portable file association is bypassed entirely in this case.

Also curious - what does the #1053 signify? I can't figure this out in the help files.

jupe
Posts: 3478
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Custom column - count of times file opened?

Post by jupe »

Yes opening through the context menu opens via the shell directly bypassing portable file associations

#1053 is a command id,

#1053 Miscellaneous | File Operations | Open Selected Item(s) with OS Default (Ctrl+Shift+Enter)

you can look up the command IDs under the Help Menu | List all Commands, or alternatively make them always visible with Help | Command IDs on Menus, all these numbers can be used in scripts directly.

Post Reply