Attribute setting

Features wanted...
Post Reply
oblivion
Posts: 142
Joined: 13 Apr 2011 11:35

Attribute setting

Post by oblivion »

Sometimes, I want to modify timestamps on files.

The functionality to do it in the properties tab of the info panel is useful but it would be rather lovely if (a) a date picker dialog was available, (b) it was possible to sync Created and Modified stamps to save setting them separately and (c) if the tick could be actioned with some sort of keyboard action rather than having to reach for the mouse (I grant that's less of an issue if option a existed!)

(I have a folder of podcasts that I try to listen to chronologically, but if I don't download them on the day they were made I have to set the file's timestamp to match the rss feed to ensure they stay in the "right" order. You're going to tell me I should try to write a script to do it, aren't you? ;) )
-- bests, Tim

...This space unintentionally left blank.

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Attribute setting

Post by highend »

Write a script^^

You want to do something in a batch anyway, so...
One of my scripts helped you out? Please donate via Paypal

oblivion
Posts: 142
Joined: 13 Apr 2011 11:35

Re: Attribute setting

Post by oblivion »

highend wrote:Write a script^^

You want to do something in a batch anyway, so...
Not a batch. Only ever one file at a time. (I might download six podcasts in a session but their date/timestamps will potentially all be different.)

I knew someone would suggest I write something. :)

I have thus far failed to acquire any scripting skills in XYplorer, despite having decided a couple of years ago that I needed to. Maybe this is a good reason to try to do something. However, oblivion <> :ugeek:

;)
-- bests, Tim

...This space unintentionally left blank.

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Attribute setting

Post by highend »

If you need help, feel free to ask :mrgreen:
One of my scripts helped you out? Please donate via Paypal

oblivion
Posts: 142
Joined: 13 Apr 2011 11:35

Re: Attribute setting

Post by oblivion »

highend wrote:If you need help, feel free to ask :mrgreen:
Thanks! I'll try not to make you regret that offer :)
-- bests, Tim

...This space unintentionally left blank.

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Attribute setting

Post by highend »

I said: feel free to ask, not: expect an answer :whistle:
One of my scripts helped you out? Please donate via Paypal

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Attribute setting

Post by highend »

For example...

This one displays a date picker and after choosing one it sets
the created + last modified date of the current file to that date
and the current time...

The ($date) check is necessary to not do anything when you cancel
the date picker dialog window

Code: Select all

    $date = datepicker();
    if ($date) {
        $date = $date . " " . now("hh:nn:ss");
        timestamp "cm", $date, "<curitem>";
    }
One of my scripts helped you out? Please donate via Paypal

oblivion
Posts: 142
Joined: 13 Apr 2011 11:35

Re: Attribute setting

Post by oblivion »

highend wrote:For example...
This one displays a date picker and after choosing one it sets
the created + last modified date of the current file to that date
and the current time...
:shock: I'm in awe.

That's IT?

I expected to have to write a LOT of code.

I have a lot to learn. I think I need to understand a lot better what's available to me and how to apply that to a problem.

Thanks for giving me a push in the right direction!
-- bests, Tim

...This space unintentionally left blank.

oblivion
Posts: 142
Joined: 13 Apr 2011 11:35

Re: Attribute setting

Post by oblivion »

I sort of get that this is getting more and more offtopic but just in case it's useful to anyone:

And particularly to say "thanks" to highend for the example without which I'm quite sure I wouldn't have known where to even start...

I wanted to have the starting point for the new datestamp for the file to be its original setting. I also wanted a timestamp that was tidier than the current time, but I don't think I want to make it specifically editable. So my version of it looks like this:

Code: Select all

$date = datepicker(<datem dd-mm-yyyy>);
	if ($date) {
		$date = $date . " " . 01:00:00;
		timestamp "cm", $date, "<curitem>";
	}
Thanks, highend! :beer:
-- bests, Tim

...This space unintentionally left blank.

Post Reply