Re: Script performance and Safari
Re: Script performance and Safari
- Subject: Re: Script performance and Safari
- From: Simon Topliss <email@hidden>
- Date: Sat, 14 Apr 2012 15:32:00 +0100
On 14 Apr 2012, at 14:53, KOENIG Yvan wrote:
> Le 14 avr. 2012 à 14:59, Simon Topliss a écrit :
>
>> On 14 Apr 2012, at 13:52, KOENIG Yvan wrote:
>>
>>>
>>> Le 14 avr. 2012 à 13:42, Christopher Stone a écrit :
>>>>
>>>>
>>>> ------------------------------------------------------------------------------------------------
>>>> on dateStr()
>>>> tell (current date)
>>>> set d to (its month as number) & (its day as number) & (its year) mod (((its year) div 1000) * 1000)
>>>> set {oldTIDS, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"}
>>>> set d to d as text
>>>> set AppleScript's text item delimiters to oldTIDS
>>>> return d
>>>> end tell
>>>> end dateStr
>>>> ------------------------------------------------------------------------------------------------
>>>
>>> It seems a bit complicated.
>>>
>>> Why not :
>>>
>>> tell (current date)
>>> return "" & (its month as number) & "/" & its day & "/" & (its year) mod (((its year) div 1000) * 1000)
>>> end tell
>>>
>>> or
>>>
>>> tell (current date)
>>> return "" & (its month as number) & "/" & its day & "/" & text -2 thru -1 of ("" & its year)
>>> end tell
>>
>> Even simpler still:
>>
>> return short date string of (current date)
>>
>
> I didn't took it because the original code was removing the leading zero when day is smaller than 10 ;-)
Ah, right. Didn't notice that bit.
Still no divs, mods or tids required:
tell short date string of (current date) to return text 1 thru -5 of it & text -2 thru -1 of it
Simon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden