• 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: Days and hours
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Days and hours


  • Subject: Re: Days and hours
  • From: Yvan KOENIG <email@hidden>
  • Date: Thu, 20 Oct 2005 11:54:19 +0200


Le 20 oct. 2005 , à 3:55, kai a écrit :


tell "1 1 1" to tell my date it
set day to 25
set w to date string's words
set day to 32
considering case
tell date string's words to repeat with i from 1 to count
tell item i to if it is not w's item i and it is not "1" then
set l to {w's item i, it}
exit repeat
end if
end repeat
end considering
repeat 10 times
set day to 32
set l's end to date string's word i
end repeat
end tell
choose from list l


------------

---
kai

Thanks Kai.

I inserted your code in the script I passed some times ago to give a complete response to Bernard AZANCOT.

property mois_anglais : {January, February, March, April, May, June, July, August, September, October, November, December}

property titre : "Employment month"
property my_prompt : "Enter the month for which you wish to compute hours worked."


set {local_monthNames, monthName_offset} to my build_local_months()

set hrs to 0
set working_month to current date
set defaut_anglais to month of working_month
repeat with i from 1 to 12
	if defaut_anglais is mois_anglais's item i then exit repeat
end repeat
set defaut_francais to (local_monthNames's item i) as text

--set mon to (choose from list mois_anglais with title titre with prompt my_prompt default items {month of working_month})
set mon to (choose from list local_monthNames with prompt my_prompt default items {defaut_francais})
set choix_francais to mon as text
repeat with i from 1 to 12
if choix_francais is local_monthNames's item i then exit repeat
end repeat
set choix_anglais to (mois_anglais's item i) as text


on build_local_months()
	tell "1 1 1" to tell my date it
		set day to 25
		set w to date string's words
		set day to 32
		considering case
			tell date string's words to repeat with i from 1 to count
				tell item i to if it is not w's item i and it is not "1" then
					set l to {w's item i, it}
					exit repeat
				end if
			end repeat
		end considering
		repeat 10 times
			set day to 32
			set l's end to date string's word i
		end repeat
	end tell
	return {l, i}
end build_local_months

Yvan KOENIG

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Days and hours (From: "Nigel Garvey" <email@hidden>)
 >Re: Days and hours (From: kai <email@hidden>)

  • Prev by Date: Re: Folders within folders
  • Next by Date: Exporting multiple text boxes in Quark to single file
  • Previous by thread: Re: Days and hours
  • Next by thread: Re: Days and hours
  • Index(es):
    • Date
    • Thread