changing dates in bulk

Post Reply
vkfoto
Posts: 111
Joined: 19 Oct 16 3:51

changing dates in bulk

Post by vkfoto » 10 Sep 20 22:47

Is there a way to extract the date from the file name and apply it to the create date of the image?
My images all get renamed yyyy-mm-dd-hh-mm-ss by the file importer. For some reason some don't have the create date set correctly. Especially scanned images.
Doing this one at a time manually is not on the table, there are too many. A script or function?

Hert
Posts: 6334
Joined: 13 Sep 03 7:24

Re: changing dates in bulk

Post by Hert » 10 Sep 20 23:55

This perhaps?
viewtopic.php?t=27839
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

vkfoto
Posts: 111
Joined: 19 Oct 16 3:51

Re: changing dates in bulk

Post by vkfoto » 11 Sep 20 1:16

I selected one file with a date coded in the file name. 1991-03-31 21-52-06.2.TIF
I copy pasted the code from the link above into Scripter Studio in to a new script. Saved it under its own name. Compiled without errors. Click Run and got a Script Runtime error.
IDI.v5.ApplicationException

----- details -----

ExceptionTimeStamp=2020-09-11T00:14:55.520Z
ExceptionThreadName=Main Thread
ExceptionClass=EatScripterRuntime
Exception=SCRIPT RUNTIME ERROR
Access violation when evaluating instruction PushVar ($0,$0,$0,$0,'Result').
Stack content is: [OleStr:1991-03-31-21-52-06.2,...].
Source position: 81,6
Build=5.5.1.3114
Edition=Single
Architecture=64 bit
Platform=Windows
OperationSystem=Windows 10 64bit (Version: 10.0.18363)
Display=1920x1200
AvailableMemory=9 GB of 15.9 GB
ProcessorCores=8
Trial=no
UptimeSecs=27669
SystemID=234A52551011D90A2B2734D8CF82B4DB
CallStack= $0000000100A280FB RUNTIMEERROR, line 2052 of ../../XOM/Scripting/atScript.pas
$0000000100A34AC7 HANDLESCRIPTRUNEXCEPTION, line 7408 of ../../XOM/Scripting/atScript.pas
$0000000100A346F3 EXECPROCESS, line 7375 of ../../XOM/Scripting/atScript.pas
$0000000100A39030 _CALL, line 8423 of ../../XOM/Scripting/atScript.pas
$0000000100A34683 EXECPROCESS, line 7353 of ../../XOM/Scripting/atScript.pas
$0000000100A39030 _CALL, line 8423 of ../../XOM/Scripting/atScript.pas
$0000000100A39463 _TRYFINALLY, line 8488 of ../../XOM/Scripting/atScript.pas
$0000000100A34683 EXECPROCESS, line 7353 of ../../XOM/Scripting/atScript.pas
$0000000100A33F87 EXECUTESUBROUTINE, line 7144 of ../../XOM/Scripting/atScript.pas
$0000000100A3376A EXECUTE, line 6972 of ../../XOM/Scripting/atScript.pas
$0000000100A2871C EXECUTE, line 2374 of ../../XOM/Scripting/atScript.pas
$00000001008E2A40 EXECUTE, line 620 of ../../XOM/Scripting/xomScripter.pas
$00000001008E27AD EXECUTE, line 581 of ../../XOM/Scripting/xomScripter.pas
$0000000100DBF031 ACTRUNEXECUTE, line 492 of ../../XOM/Scripting/formQuickScript.pas
$00000001001F4A52 DOCLICK, line 63297 of ../../XOM/DXscene/dx_vgcore.pas
$00000001001F4EDE CLICK, line 63422 of ../../XOM/DXscene/dx_vgcore.pas
$000000010016FD70 CLICK, line 25137 of ../../XOM/DXscene/dx_vgcore.pas
DatabaseSystem=SQLite
ActiveCollectionCount=631
ActiveForm= frmQuickScript[TfrmQuickScript]
ActiveForm.ActiveControl= frmQuickScript[TfrmQuickScript]
vxScene1[TvxScene]
ActiveForm.Scene.Hovered= Root1[TvxBackground]
loToolbar[TvxLayout]
mtbMain[TvxMacToolBar]

vkfoto
Posts: 111
Joined: 19 Oct 16 3:51

Re: changing dates in bulk

Post by vkfoto » 11 Sep 20 2:52

hmm, if the file name is only
1991-03-29 20-17-10.TIF
it works but if there is an extra number after the seconds
1991-03-31 21-52-06.1.TIF
or
1991-04-03 21-54-58.10.TIF
I get the runtime error.

How do I modify the script to deal with the extras which are not always used?

vkfoto
Posts: 111
Joined: 19 Oct 16 3:51

Re: changing dates in bulk

Post by vkfoto » 11 Sep 20 3:31

A quick solution was to remove the dot between the time and the sequence number so
1991-04-03 21-54-58.10.TIF
became
1991-04-03 21-54-58 10.TIF

Post Reply