Re: Script performance and Safari
Re: Script performance and Safari
- Subject: Re: Script performance and Safari
- From: KOENIG Yvan <email@hidden>
- Date: Sat, 14 Apr 2012 15:53:19 +0200
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 ;-)
Yvan KOENIG (VALLAURIS, France) samedi 14 avril 2012 15:52:54
_______________________________________________
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