How to show results of a script in a custom column: ?

Discuss and share scripts and script files...
Post Reply
SL09
Posts: 48
Joined: 13 Jun 2009 13:54

How to show results of a script in a custom column: ?

Post by SL09 »

I saw an old forum post about creating a column with the time difference between 'CreatedDate' and 'ModifiedDate'. This is what I would need: show image files where the two are not identical [in a range from over some minutes]. However, the code I found there does nothing I would see:
return datediff(filetime(<cc_item>, "c"), filetime(<cc_item>, "m"), "d");

If I use the address bar to enter
::echo datediff(filetime(<cc_item>, "c"), filetime(<cc_item>, "m"), "d");
the result is always "0" although the times are different ...

Since I have no experience with scripts, I have absolutely no clue how to manage this - 'Tour - Scripting' didn't help me. How to write a script that calculates the time difference (e.g. in hours) ? It would have to work through a hierarchy of subfolders, like D:\Fotos.
How to create a column and how to connect it to the script ?
I imagine I could then sort this column, like any other, by size ?

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

Re: How to show results of a script in a custom column: ?

Post by highend »

Probably because the first command calculates the time difference in days, not hours?

The second one wouldn’t work in the address bar anyway, <cc_item> does only work in a custom column script…
One of my scripts helped you out? Please donate via Paypal

SL09
Posts: 48
Joined: 13 Jun 2009 13:54

Re: How to show results of a script in a custom column: ?

Post by SL09 »

I got one (small) step further:
In a post from 2011 I found this dialog [c.png] - altough it is quite hidden. So I created a new column and configured it (Caption, Type 'Script',
Format 'Text', Trigger 'Click', Item type: 'Files', Item filter: CR2.

As script, I try
return datediff(filetime(<cc_item>, "c"), filetime(<cc_item>, "m"), "h");
no info is displayed in the column !

A script copied from the help file also results in no reaction whatsoever (e.g.)
$a = substr(<cc_name>, 3, 5);
return $a;
)

Only the starting delay when I open a new instance of XYPlorer has augmented very much ...
Attachments
c.png
c.png (22.67 KiB) Viewed 2306 times

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

Re: How to show results of a script in a custom column: ?

Post by highend »

Show a screenshot of the pane with visible file names, the date (m+c) and the cc column (with the script from the "cc: 16 resolution" graphic)
One of my scripts helped you out? Please donate via Paypal

Post Reply