• 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: Make iCal Reload Via AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make iCal Reload Via AppleScript


  • Subject: Re: Make iCal Reload Via AppleScript
  • From: Chris Garaffa <email@hidden>
  • Date: Tue, 6 Jan 2004 19:03:13 -0500

On Jan 6, 2004, at 6:19 PM, Jean-Olivier Lancttt-D. wrote:

Hi all,

I'm trying to make iCal.app reload its cals (when it's running)

So I look at the available iCal commands and I see "reloadCals"

Where do you see this? I have:
reload calendars: Tell the application to reload all calendar files contents
reload calendars reference -- the object for the command

on 10.3.2, iCal 1.5.1.

I'm not sure what "reference" is for, because setting it to a reference to a calendar makes the script fail.
This should work (at least, it doesn't give an error here):

tell application "iCal"
reload calendars
end tell

[snip some code]


try
tell application "iCal"
reloadCals
end tell
end try

and it runs w/o errors

the problem is that it does NOT reload the cals :\

What am I doing wrong here?

and why does adding try/end try resolves the errors?

Adding try/end try alone will cause a script to silently fail on an error. That's useful in some cases, but not here.
This:
try
tell application "iCal"
reloadCals
end tell
on error theError
display dialog theError
end try

should display a dialog box, depending on how you're running the script (it will in a script/script application, probably will as an NSAppleScript and I don't believe it will if used with osascript), with the error.

--
Chris Garaffa
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Make iCal Reload Via AppleScript (From: "Jean-Olivier Lanctôt-D." <email@hidden>)

  • Prev by Date: Re: NSSpellServer & period
  • Next by Date: Re: New to cocoa/database
  • Previous by thread: Make iCal Reload Via AppleScript
  • Next by thread: Re: Make iCal Reload Via AppleScript
  • Index(es):
    • Date
    • Thread