I have some strings like these…
05-30-2008 MD Slider.mov
05-29-2008 MD Slider.mov
05-28-2008 MD Slider.mov
I have two things I want to do: Isolate the date into one variable and the rest of the string (minus “.mov”) into another.
I know the first 10 characters will always be the date, but the multiple spaces are messing with my ability to get the rest out via AppleScript Text Item Delimiters. I figured I could use a space as the delimiter then get the date
set AppleScript's text item delimiters to space
set theDate to text item 1 of this_item
…and this worked. Then I thought I’d use “.mov” as the next delimiter to isolate the “MD Slider” text, but instead I got “05-30-2008 MD Slider”. Obviously, I realized, since the first text item delimiter operation didn’t remove the date characters from the this_item variable.
This got me thinking I cannot rely on spaces as delimiters.
I can count on the first 10 characters being my date, so can I remove the first 10 characters into my Date variable leaving the " MD Slider.mov" in the either the original variable or in a new one? This non-date string can easily lose its “.mov” and the leading space to get the second part of what I need.