Re: iCal scripting problem
Re: iCal scripting problem
- Subject: Re: iCal scripting problem
- From: Christian Boyce <email@hidden>
- Date: Sat, 2 Oct 2004 15:31:52 -0700
This indeed solves the problem but holy cow, how would anyone know
about the existence of "iCal Helper" and/or this business about who is
really running the script? I guess this is one of those "that's the way
it is, accept it and move on" but it sure would be nice if Apple would
make scripting its own programs a little bit easier to figure out.
Might there be a way to set a property after the script has run once,
and then to check the value of the property, etc.? I was heading in
that direction but didn't get it to work. I'm not very experienced with
properties so I'm not so sure that the problem wasn't me.
Much obliged. You solved my problem, Paul.
(What I'm really doing with my script is sending emails to a group of
people reminding them of events in the calendar, not just putting up
dialog boxes that say "yo.")
cb
Events can trigger alarms via two applications: iCal and iCal helper.
iCal helper checks to see if iCal is running, and keeps quiet if it
is, but the reverse does not occur i.e iCal does not check to see if
iCal Helper is running.
To see what I mean set an event to trigger the following script with
iCal not initially running, and then when it is. When it is not
running, the script should report that the application running it is
"iCal" and then "iCal helper". "iCal helper runs the first copy of the
script, which launches iCal. As it activates, iCal sees that it must
trigger an alarm for the same event, so it launches a second copy of
the script, which reports that it was launched by "iCal". This script
then terminates, returns control to iCal, which returns control to the
first copy of the script, which reports that it was launched by iCal
helper.
--code begins
tell application "iCal"
activate
display dialog "Name of application executing script is: " & (name of
me) as string
end tell
--code ends
The solution to the problem is along the lines of:
--code begins
tell application "iCal"
activate
if ((name of me) as string = "iCal") then
display dialog "This script will execute twice, but this message is
only displayed when iCal is running it."
end if
end tell
--code ends
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden