• 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: iCal moving events to calendar not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iCal moving events to calendar not working


  • Subject: Re: iCal moving events to calendar not working
  • From: "David A. Cox" <email@hidden>
  • Date: Fri, 25 Jul 2008 16:36:17 -0700

Thanks for the more improvements to the efficiency of the script. I will look at the suggestions in the context of my scripts (this is a simplified version of the script, and this section only deals with the events if the system is a 10.5 system. But I think the suggestions that you have will improve the code.

If all the events do end up moving, then that was a mistake in my cleaning up the code too much :). I think that all TENTATIVE events will move, and all declined and unknown events will move, but if an event is not tentative, and I have said I will go to it, it should not be moved.

I have seen the problem with things not moving, and the console error showing up on every machine I have tested, so I feel like the problem must be somehow involved with the code I have written, or something odd in iCal.

Thanks again for taking some time to look at this. It really helps to have someone else poke at these sorts of things after spending too much time in the code myself.

DAC
On Jul 25, 2008, at 2:42 PM, Nigel Garvey wrote:

"David A. Cox" wrote on Thu, 24 Jul 2008 16:51:55 -0700:

I am trying to look at a calendar (imported into iCal) and move the
events to set of other calendars depending on my attendance status for
the meeting. But when I run the script (a condensed version of it
below), the events often move to the wrong calendar, and then either
disapear after a moment, or disapear if I quit iCal and launch it again.

I haven't had enough time with my G5 today to be able to set up a
situation to test your script. The way it's written, _every_ event will
be moved somewhere, even if you're not one of the attendees. Is that what
you want?


There are one or two optimisations that could be made, notably using a
'whose' filter instead of a repeat loop to identify the your attendee:

			if e's status is tentative then
				set TentativeStatus to true
			end if

			set {theAttendees} to e's {attendees}


			repeat with j from 1 to (count theAttendees)


				set CurrentAccount to item j of theAttendees

				if display name of CurrentAccount is MyCalName then
					set MyStatus to participation status of CurrentAccount

					if MyStatus is declined then
						set MoveToDelete to true


					else if MyStatus is unknown then
						set MoveToUndecided to true
					end if
				end if

			end repeat

set TentativeStatus to (e's status is tentative)

   tell (first attendee of e whose display name is MyCalName)
     if (it exists) then
       set MyStatus to its participation status

       if MyStatus is declined then
         set MoveToDelete to true

       else if MyStatus is unknown then
         set MoveToUndecided to true
       end if
     end if
   end tell

Also, of course, expressions like 'if TentativeStatus is true' can be
reduced to 'if TentativeStatus'.

Otherwise, I can't see anything desperately wrong with your code. It
sounds as though something may have become corrupted.

NG

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
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
References: 
 >Re: iCal moving events to calendar not working (From: "Nigel Garvey" <email@hidden>)

  • Prev by Date: Re: Computer Serial Number
  • Next by Date: Re: replacing embedded images in Illustrator
  • Previous by thread: Re: iCal moving events to calendar not working
  • Next by thread: Re: iCal moving events to calendar not working
  • Index(es):
    • Date
    • Thread