• 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: Time format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Time format


  • Subject: Re: Time format
  • From: KOENIG Yvan <email@hidden>
  • Date: Sun, 18 Nov 2007 12:23:11 +0100


Le 18 nov. 07 à 12:06:55, ba95 a écrit :

try
with timeout of 1000 seconds
tell application "Finder"
set debutemps to (current date)
set time1 to (time of (current date))

--Blah, blah...

set TotalTime to (time of (current date)) - time1

-- Time formating
set t to TotalTime
set h to t div 3600
set tr to (t mod 3600)
set x to (tr div 60)
set m to leadZero(x) -- 'of me' tried unsuccessfully
set x to (tr mod 60)
set s to leadZero(x) -- 'of me' tried unsuccessfully
set TotalTime to m & ":" & s as string

on leadZero(x)
if x is less than 10 then
return "0" & x
else
return x as string
end if
end leadZero
-- End of time formating

end if
end tell
end timeout
end try


Your end tell instruction is wrongly placed.

Move it like that:

set TotalTime to m & ":" & s as string
end tell -- to Finder

on leadZero(x)

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: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Time format (From: ba95 <email@hidden>)

  • Prev by Date: Re: Time format
  • Next by Date: Applescript schedulers
  • Previous by thread: Re: Time format
  • Next by thread: Re: Time format
  • Index(es):
    • Date
    • Thread