My friend has a hair salon website where she wants to upload an image to the gallery each day automatically from a folder of dated hair style images. https://silverscissorsfamilysalon.com/s ... s-gallery/
The images are located in a folder on the computer. Each image is labeled with the date it was added to the folder. For example when she adds todays image it will be labeled 08212023.jpg tomorrows will be labeled 08222023.jpg and so on.
I need a script that will get todays date 08/21/2023, then select the image with that same number 08212023.jpg
I have no idea where to start or if MS can even do this. Anyone have any ideas?
I can always set her camera to name them something else, if that helps, but I dont even know where to start with a script that will select an image with todays same date
select todays dated image
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1378
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: select todays dated image
If you want to start with 08/21/2023 and end up with 08212023.jpg, you can simply use StringReplace to replace the "/" with "nothing", then add the path and .jpg to the result.
The other way would be to deconstruct the date elements and then reconstruct them.
Code: Select all
//Get the date
GetDate>TheDate
//Replace the /
StringReplace>TheDate,/,,TheDate
//Set the path to your file
Let>FilePath=c:\MyFilePath\%TheDate%.jpg
Code: Select all
//Get the date
GetDate>TheDate
//Separate out all the parts
Separate>TheDate,/,DateParts
//Get the mm,dd, and yyyy
Let>mm=DateParts_1
Let>dd=DateParts_2
Let>yyyy=DateParts_3
//Put them back together again
Let>DateString=%mm%%dd%%yyyy%
//Set the path to your file
Let>FilePath=c:\MyFilePath\%DateString%.jpg
Yes, we have a Custom Scripting Service. Message me or go here
-
- Newbie
- Posts: 9
- Joined: Sun Jul 23, 2023 4:57 pm
Re: select todays dated image
thanks, Ill work on this! Appreciate the reply!
- Grovkillen
- Automation Wizard
- Posts: 1128
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: select todays dated image
If you don't want to trust the local date format I would use:
Code: Select all
Year>TEMP_YYYY
Month>TEMP_MM
Day>TEMP_DD
Let>THE_DATE=%TEMP_YYYY%%TEMP_MM%%TEMP_DD%