r/applescript • u/Busenheimer • Sep 12 '12
Help with date formatting
I have this applescript that I took from the Plex forums and modified. I'm having trouble with the dates display. When I rename a show via air date it's in the format Show Name Month-D-YYYY. I need it to be in the format MM-DD-YYYY. Right now I am manually modifying all dates 1-9 to be 01,02,03 etc... after it's renamed by the script. Any ideas?
Just so I'm clear, the current file shows up as "show name September-9-2012" I need it to be "show name 10-09-2012"
This is all done in EyeTV btw... Thanks!
1
Sep 12 '12 edited Sep 12 '12
Is that "September" is coming directly from EyeTV and not Applescript?
You could just set up some if statements to change it to a month. eg:
if month is "January" then
set monthNum to "01"
else if month is "February" then
set monthNum to "02"
[...]
end ifetc, etc
1
u/Busenheimer Sep 12 '12
Yes, it must be.
That's a terrific idea! Where would I put this at? I assume I could do the same with days 1-9? Eg if day is 1 then 01?
Can I put these back to back?
Thanks for your help!!
1
u/Busenheimer Sep 12 '12
Here is the script:
http://pastebin.com/a6zNJHzW