name of this document
name of this document
- Subject: name of this document
- From: Ronald Hofmann <email@hidden>
- Date: Tue, 23 Sep 2008 08:02:15 +0200
Hi everybody,
in order to write error logs I want to know the name of the script
which writes to the error log.
Of course, I could write the name of the script into a parameter of
the error call like this:
write_cmd_error_log("/Users/ronny/Desktop/ErrLog.txt",
"theErrMessage","setAliasToOrgModDate")
This is the way I did it so far.
What I want is:
write_cmd_error_log("/Users/ronny/Desktop/
ErrLog.txt","theErrMessage",theNameOfThisScriptDocument)
In this case I only have to fill in theErrMessage. Much more
comfortable.
Any suggestions?
Greetings, Ronald
---
Am Mo22.09.2008 ยท 39 um 18:15 schrieb K.Olson:
Relative noob here.
This is my first time scripting iCal. I am having problems
understanding the best way to capture/validate a variable if it is
undefined. For instance if I uncomment the try block I don't get an
error. If I run this as is I get the expected dialogs for the first
5 entries (this calendar has 61 entries) or so then I get an Error:
"The variable thisLocation is not defined."
I can try and capture and display what is going on and I think I see
that thisEvent variable has no value for location. I think. I
tried to enter a preliminary check on the variable thisLocation but
it doesn't seem to catch the problem. This is obviously the start
of a script that is in the building stage but I am stuck on getting
past this.
property local1 : "Client One"
property theEvents : {}
tell application "iCal"
activate
set theEvents to every event of calendar 1 of application "iCal"
set eventCnt to count of theEvents
set event1 to item 1 of theEvents
--try
repeat with n from 1 to eventCnt
set thisEvent to item n of theEvents
set thisLocation to location of thisEvent
--try and reset the variable if it is empty
if thisLocation is null then
set thisLocation to "none"
else
set thisLocation to thisLocation
end if
if thisLocation is local1 then
display dialog "success"
else
display dialog "You are going to " & thisLocation
end if
end repeat
--end try
end tel
_______________________________________________
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