Re: on error result, how to parse
Re: on error result, how to parse
- Subject: Re: on error result, how to parse
- From: Christopher Nebel <email@hidden>
- Date: Tue, 5 Feb 2008 12:24:04 -0800
On Feb 5, 2008, at 3:40 AM, email@hidden wrote:
Yes replying to my own post!
on error errtxt
my log_eventlocal("Error with Account Creation"& errtxt)
end try
on log_eventlocal(themessage)
set theLine to (do shell script "date +'%Y-%m-%d %H:%M:%S'" as
string) & " " & themessage
do shell script "echo " & theLine & " >> " & logpath & "/test.txt"
end log_eventlocal
but the error returned by the lovely Entourage has a ' in text..
which catches out my shell script!
:(
i'll have a think....
The "quoted form" property is your friend:
do shell script "echo " & quoted form of theLine & " >> " & logpath &
"/test.txt"
For other tips on using "do shell script", see <http://developer.apple.com/technotes/tn2002/tn2065.html
>.
--Chris Nebel
AppleScript Engineering
_______________________________________________
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