Re: Subroutine Question
Re: Subroutine Question
- Subject: Re: Subroutine Question
- From: "Mark J. Reed" <email@hidden>
- Date: Sun, 18 Apr 2010 17:27:50 -0400
What's with all the extra parameters to date? It's very silly to call date to ask it for the current date, then turn around and feed that answer back to a second call of date, saying "hey, give me THIS date instead of the current date, but do it in epoch seconds form!"
All you need is this:
on EpochSeconds()
do shell script "date +%s"
end EpochSeconds
On Sun, Apr 18, 2010 at 2:24 PM, Wayne Melrose
<email@hidden> wrote:
()
set start_Time to EpochSeconds()
on EpochSeconds()
return do shell script "date -j -f \"%a %b %d %T %Z %Y\" \"`date`\" \"+%s\""
end EpochSeconds
Sent from my iPhone
What's the correct syntax to code a subroutine which does not need any input parameters passed to it but does get a value back?
I have to pass something unnecessary like so:set start_Time to EpochSeconds(1)on EpochSeconds(x) return do shell script "date -j -f \"%a %b %d %T %Z %Y\" \"`date`\" \"+%s\""
end EpochSecondsI can't just do:set start_Time to EpochSecondson EpochSeconds
return do shell script "date -j -f \"%a %b %d %T %Z %Y\" \"`date`\" \"+%s\""end EpochSecondsWhat's the best way to set my start_Time to the value returned by my EpochSeconds subroutine?
-- Geeks and Nerds: <http://www.otfb.com/blog/?p=918>_______________________________________________
Do not post admin requests to the list. They will be ignored.AppleScript-Users mailing list (email@hidden)
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
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
--
Mark J. Reed <
email@hidden>
_______________________________________________
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