• 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: Changing the time of an event using CalendarLib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing the time of an event using CalendarLib


  • Subject: Re: Changing the time of an event using CalendarLib
  • From: Shane Stanley <email@hidden>
  • Date: Tue, 07 May 2019 14:10:05 +1000

On 7 May 2019, at 1:28 pm, Christian Boyce <email@hidden> wrote:
>
> I would expect my event to go from an all-day event to an event starting at
> 10 pm and ending on 11:30 pm. But what I get is different. The event loses
> its all-day status but it lands at 12 noon, not at the specified time.

That sort of makes sense. If you look at the code, you will see setAllDay:
happens after setStartDate: and setEndDate:, so those values get effectively
overridden at that point.

Try something like this:
>
> set theResult to modify event event anEvent destination calendar existingCal
> without runs all day
>
> set theResult to modify event event anEvent starting date theStartDateTime
> ending date theEndDateTime destination calendar existingCal
>
> store event event anEvent event store existingStore -- save the event

You generally don't need to include parameters that have already been set.

--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
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: 
 >Changing the time of an event using CalendarLib (From: Christian Boyce <email@hidden>)

  • Prev by Date: Changing the time of an event using CalendarLib
  • Next by Date: Osx Mail : Deleting Maiboxes
  • Previous by thread: Changing the time of an event using CalendarLib
  • Next by thread: Re: Changing the time of an event using CalendarLib
  • Index(es):
    • Date
    • Thread