Problem with colons (:)

I wrote time ago, on Panther (vers. 10.3) a Script to identify the day (as string, like thursday) of futur or ancient dates (like 1400 or 2030 as year)
Moving to Tiger (10.4) i discover with disappointing that colons now, are recognized not more as divisor signs, but the time string like 12:03:01 results as a single word, word 5 of

get (current date) as text

Before 12:03:01 was read as word 1= 12, word 2=03, word 3=01
So, i ask if this is modificable, with a global or property? (commands where i use rarely, yet to discover), at last, perhaps thru a plugin?
Because it is much more inconvenient to filter thru characters, as thru words. :**

Why deal with the word positions at all?

set d to (current date) as date
set mo to month of d as number
set dy to day of d
set yr to year of d
display dialog mo & " " & dy & " " & yr as text

Hi,

in Tiger you can gather hours, minutes, seconds directly


tell (current date) to set {yr, mo, dy, hr, mn, sc} to {year, its month, day, its hours, its minutes, its seconds}

excellent!
it’s really annoying, that already with little system updates and his apparently insignificant little changes (related to Scripteditor) the entire script returns useless.
I’m very happy, that your solution is so clear and simple. Thanks, Yes!

Languages are changing permanently, in real and in virtual life :wink:
It’s always recommended to read the release notes after a major update

Hi.

If you look in Tiger’s System Preferences application → “International” panel → “Language” tab, there’s a pop-up menu at the bottom governing “Word break” behaviour. If you select “Standard” in that, you should get back the old colon behaviour.

But Stefan and cwtnospam are absolutely right. It’s much better to read the properties you want directly from the date object than to try parsing the date-as-string. The format of the string ” and the definition of a “word” ” depend on the user’s preference settings.

If you want to make your improved date scripts compatible with systems earlier than Tiger, get the time of the date (which is in seconds since midnight) and derive the hours, minutes, and seconds with the appropriate maths:


tell (current date) to set {yr, mo, dy, tm} to {year, its month, day, time}
set hr to tm div hours
set mn to tm mod hours div minutes
set sc to tm mod minutes

In this context, hours and minutes have their older meanings as the number of seconds in an hour and in a minute respectively.

thanks to all for these interesting suggestions…
My problem is solved. I like it to have several options (opportunities) to filter
and call commands, but not only direct referrals, because it turns handy for me
in a lot of manipulator operations.