Re: Recurring Reminders/Calendar Events?
Re: Recurring Reminders/Calendar Events?
- Subject: Re: Recurring Reminders/Calendar Events?
- From: Shane Stanley <email@hidden>
- Date: Sat, 07 Mar 2015 09:34:22 +1100
On 7 Mar 2015, at 4:21 am, Alex Hall <email@hidden> wrote:
Working with an amalgamation of two languages is very different.
Given that both are noted for their verbosity, the result of the dalliance was never going to produce something succinct. display dialog (current application's NSString's stringWithFormat_("%@. Starts on %@", e's title(), e's startDate())) as text
This is great--I forgot we can now use NSString stringWithFormat: and it will make things much easier.
Just be aware that it works with Cocoa stuff, but behaves a bit strangely if you try convincing yourself that you can pass primitive values. It feels weird to say "current application's NSString…", but it works.
You can say 'current application's class "NSString"' if you'd prefer more typing practice :-)
The description property doesn't seem to make a difference; I see "yyyy-mm-dd hh:mm +hhhh" whether it's in there or not.
You need it in the first example. When you put %@ in a format string, it uses the description property. Hopefully I can cast this to a regular date object and format it how I want, check for how far away it is, and so on.
If, by regular date, you mean AppleScript date, then conversion is a bit messy. For some unknown reason, the two classes are not bridged. But it is a regular (NS)Date object. So you can do things like:
e's startDate()'s timeIntervalSinceNow()
And you can use date formatters to format it every which way.
|
_______________________________________________
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