2022-09 File Renaming JScript within Directory Opus Environment

Job ID: 34743508

Budget: $30 – $250 AUD

Background
==========
Consider the following
- Google Pixel Android Phone
- Onedrive App on Android
- Take a photo with Phone
- Upload manually using Ondrive app to a folder within Onedrive


Starting_Filename_Format
========================
The files are uploaded with the following format:
PXL_YYYYMMDD_HHMMSSXXX[ Random-String].jpg
Where:
YYYY = Year e.g. 2022
MM - Month
DD - Day
HH - Hour in 24h format
MM - Minites
SS - Seconds
XXX - 3 digit index
[Random-String] - The square brackets here mean that this string may or may not exist.
It in fact does not exist when uploading files in the manner describled. However it is specified as part of the Starting_Filename_Format.

The timezone of the timestamp in the Starting_Filename_Format is UTC+0

Objective
=========
The aim of this script is to
O1. Convert the Date/Time in the filename from UTC+0 to UTC+10. Depending on time of day the date may or may not change.
O2. Convert the date/time format of the filename to the following:
YYYY-MM-DD HHhMMmSSsXXX.jpg


Example01 - Hour HH parameter only changes:
===========================================
In this example the following single paramter changes:
HH before = 09; HH after = 19. HH parameter is incrmented by 10.
No other time/date parameters change:
Starting Filename UTC+00 = PXL_20220917_091912977.jpg
Intermediate Filename UTC+10 = PXL_20220917_191912977.jpg
Final Filename UTC+10 = 2022-09-17 19h19m12s977.jpg


Example02 - Hour HH and Day DD parameters change:
=================================================
In this example the following 2 paramters changes:
HH before = 19; HH after = 05. HH parameter is decremented by 14.
DD before = 17; DD after = 18. DD parameter is incremented by 1.
No other time/date parameters change:
Starting Filename UTC+00 = PXL_20220917_191912977.jpg
Intermediate Filename UTC+10 = PXL_20220918_051912977.jpg
Final Filename UTC+10 = 2022-09-18 05h19m12s977.jpg


Example03 - Hour HH, Day DD and Month MM parameters change:
===========================================================
In this example the following 2 paramters changes:
HH before = 23; HH after = 09. HH parameter is decremented by 14.
DD before = 31; DD after = 01. DD parameter is reset to 01.
MM before = 01; MM after = 02. MM parameter is incrementedby 01.
No other time/date parameters change:
Starting Filename UTC+00 = PXL_20220131_231512977.jpg
Intermediate Filename UTC+10 = PXL_20220201_091512977.jpg
Final Filename UTC+10 = 2022-02-01 09h15m12s977.jpg

Script Environment
==================
The script language should be JScript implemented within the JScript engine/facility in the Windows Explorer Replacement application Directory Opus.

Script Invocation
=================
With 1 or more files selected a button or hotkey shortcut should be invoked

Script Action
=============
Upon invocation the script should act on the currently selected files.
A1. Files matching the The Starting_Filename_Format should be renamed as described above.
A2. Files matching the Starting_Filename_Format AND have a Random-String as a suffix should be renamed as described above with the Random-String left unchanged as a suffix to the filename.
A3. Files not matching the Starting_Filename_Format should be left unchanged.

File Extension Unchanged
========================
The file extension used in the samples above are .JPG.
However the script should not change the extension and should work regardless of what the extension is.

Directory Opus License
======================
The supplier is responsible for Directory Opus licensing costs.
https://www.gpsoft.com.au/

========== END ===========
Related categories: JavaScript Software Development