This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > PainShop Pro Scripting > April 2006 > Add the Date & Time of Modification to the filename.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Add the Date & Time of Modification to the filename.
RonaldV

2006-03-09, 6:30 pm

This script is rather limited, but I find it useful. Perhaps others
will too.

It extracts the Modification Date from file information for any file
in the directory D:\DateChg and renames the file to have that
information in the filename. Underscore separates the date & time (24
hr format)

It's added in the format: yyyymmdd_hhmmss so windows will sort similar
named files by the modified time.

Modified Time is either from the creation or modification of the file,
but not the date/time the file was transferred.

(for those wondering why I don't use the EXIF.... The originals I
paint don't have EXIF.)

You can change the target directory by editing line 20.


RonV
Tangling with the Python

begin 644 AddDateTimetoFile.zip
M4$L#!!0````(`,Q8:30/0+)!8@,``.@&```;````061D1&%T951I;65T;T9I
M;&4N4'-P4V-R:7!T955M;]LV$/YNP/_ABGR07#NJ[3IM)ZP#O*A;&\!I4`\=
MBF8(&.DD$1-)@:1:&\/^>X^4%,FN$MD2^1SON>=>G&LEX(:9=%O7P$6MM(7G
MTTGWI,R"[JAFMER`Y0(78*SFLIA.II,,<]BGFM?V3JL:M>5HPED\G0!=&FVC
M)?S7OKDKV#:V5#J(H0D^*<FJ##[S]-]@,8)<J_JH>5%:CY)*XLEV@L;[XTIZ
MP#;+P)8(&;,(3&:>(E@%.:]0,H$&N`0&IL:4YQPSR+C&U"I]C+S1"V^0.PV<
M">Q4UN*XS-6)Z_?*M*3N&)<6]J6J@<+^"0.?49N>WYMHM0P&P/^]:G<L"RT>
M[-[J7B^>`U%^6OUU'0]VW2*\A6`9P+Q_/Q'Z:6TZ$4K:TCCTX7"X8?(/?-PQ
MO:WUCAUO&GG35-NFV&/],;6WZEN":>"L$J[_4M<EDP4ZTR2^OT](H>NRN+\/
MX")M=VS)C1/8J]YK"=]+U.@5-,"TS\`C$C.7@BSJHTY4^$Y^XUI)@=+V@;=6
M;UV95=Q8.C0<49EU(*7;!%$ZO<%('5><9#_F/_>@D8"4Y59`]Q2E[C/LZCHJ
MT`J_X$^:S0:S+\CT8$9/7R\W\3_#OA?Z#+!>QI>KUR/0;@"YM%/[A&T+13F7
M6=@F:_%TU@Q>O!QS2-CQS,/J%7G8C#R\5\TYS=5+PJS&++@\AQ#1-R/$'M,S
MQ.OX\FH$&)YN*:T+JK<V:UY$4U?<E6#HA!_15XUU1?!3?MP1]-4K/!]DFO<A
MSR%X<-7>AS?O@YCW7.=`'@=?%[5VK=FY''$P45N*83O'.D#'LC4*$C=K!ILV
MX`N`OV$+G^`6/M#])SQS?VY]C]92#GT?C".CRF?RZ%J#MIB%E,*B@6'(C2HT
M$P92)NENC.LE19]/&VYL,5[YXW]'PFC,&_=*"WA@HJ;R5SEU0-W0N=X=#3P5
M>\`'P0J,"IHBOP'XE_5R^6JY7EX]K%>K]>;*[1'N=%(:I+%-*QD'J&1&8VN
M5&FDCKWP^]S/S_4&2LJ!:T+!;`0]&=K])5ZMX\T5W.W()&^D"_W$@U26N7$-
MK*K4=XI>":*/VD5KW"^,X8)73(,?%=TP(#*^3^G,(UU"9-E#60IA#*W0?](-
M'M[.=Y<#RS3UL=?=?7>CA[PH/WZFDQ]02P$"%@L4````"`#,6&DT#T"R06(#
M``#H!@``&P`````````!`"``@($`````061D1&%T951I;65T;T9I;&4N4'-P
<4V-R:7!T4$L%!@`````!``$`20```)L#`````&%T
`
end
Spandex Rutabaga

2006-03-09, 6:30 pm

RonaldV wrote:
>
> This script is rather limited, but I find it useful. Perhaps others
> will too.
>
> It extracts the Modification Date from file information for any file
> in the directory D:\DateChg and renames the file to have that
> information in the filename. Underscore separates the date & time (24
> hr format)


Wouldn't it be better to use the Batch > Process capability to
choose the folder and the files to process? That would save editing
and would reduce the risk that non-image files will be modified. Of
course since I'm not paying for this, mine is just an idle comment :)
RonaldV

2006-03-09, 6:30 pm

On Thu, 09 Mar 2006 13:43:27 -0600, Spandex Rutabaga
<SpRu@agabatur.xednaps> wrote:

>RonaldV wrote:
>
>Wouldn't it be better to use the Batch > Process capability to
>choose the folder and the files to process? That would save editing
>and would reduce the risk that non-image files will be modified. Of
>course since I'm not paying for this, mine is just an idle comment :)


A fair question, though. If I had opted to use the batch process,
that would mean that I'd have to operate through PSP. This script,
although it's operated from PSP, actually bypasses all of the PSP
operations and runs directly via the operating system. When I first
started working on it, I thought I'd be doing hundreds of images, so I
wanted it lightning fast.

If you try it, you may be surprised at how fast it performs.

Still, an interesting idea you present....


RonV
Tangling with the Python
Joske

2006-03-10, 6:31 pm

RonaldV wrote:

> This script is rather limited, but I find it useful. Perhaps
> others will too.


> It extracts the Modification Date from file information for any
> file in the directory D:\DateChg and renames the file to have that
> information in the filename. Underscore separates the date &
> time (24 hr format)


> It's added in the format: yyyymmdd_hhmmss so windows will sort
> similar named files by the modified time.


> Modified Time is either from the creation or modification of the
> file, but not the date/time the file was transferred.


> (for those wondering why I don't use the EXIF.... The originals I
> paint don't have EXIF.)


> You can change the target directory by editing line 20.


I like it, it's fast indeed. I'd use it too, as I do add dates to
certain file names manually. Would it be okay if you, or I myself,
change it around a little so that it adds the date in this format

-220306
-ddmmyy

and no time?

Joske



RonaldV

2006-03-10, 6:31 pm

On Fri, 10 Mar 2006 20:05:43 +0100, "Joske" <j.backer@home.nl> wrote:

>RonaldV wrote:
>
>
>
>
>
>
>
>I like it, it's fast indeed. I'd use it too, as I do add dates to
>certain file names manually. Would it be okay if you, or I myself,
>change it around a little so that it adds the date in this format
>
>-220306
>-ddmmyy
>
>and no time?
>
>Joske
>
>


As you wish. It was a little utility I've been using and thought
perhaps others could use it too. I just uploaded a version to run
under the Batch command, in order to limit the scope of the script to
images, and allow selections from various directories. It's slower,
but you don't need to shuffle files around.

Good luck with using it.


RonV
Tangling with the Python
Jeff Wilkinson

2006-04-02, 6:44 pm

RonaldV wrote:
> As you wish. It was a little utility I've been using and thought
> perhaps others could use it too. I just uploaded a version to run
> under the Batch command, in order to limit the scope of the script to
> images, and allow selections from various directories. It's slower,
> but you don't need to shuffle files around.


sorry, but uploaded where? I don't know where your site is.
jw

--
Jeff Wilkinson
jwilkinson@mail.com
RonaldV

2006-04-03, 6:56 pm

On Sun, 02 Apr 2006 14:38:21 -0400, Jeff Wilkinson
<jwilkinson@mail.com> wrote:

>RonaldV wrote:
>
>sorry, but uploaded where? I don't know where your site is.
>jw


This newwgroup, date/time = 3/10/2006 2:57
Title = 'Just for the fun of it... Batch add the date/time of
modification to a image file'

In the list of messages, it's just after this thread. YMMV.


RonV
Tangling with the Python
Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews