• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Script performance and Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Script performance and Safari
      • From: Simon Topliss <email@hidden>
References: 
 >Script performance and Safari (From: Mark Ratledge <email@hidden>)
 >Re: Script performance and Safari (From: Christopher Stone <email@hidden>)
 >Re: Script performance and Safari (From: Christopher Stone <email@hidden>)
 >Re: Script performance and Safari (From: KOENIG Yvan <email@hidden>)
 >Re: Script performance and Safari (From: Simon Topliss <email@hidden>)

  • Prev by Date: Re: Script performance and Safari
  • Next by Date: Re: Script performance and Safari
  • Previous by thread: Re: Script performance and Safari
  • Next by thread: Re: Script performance and Safari
  • Index(es):
    • Date
    • Thread