Re: Where to log lines go
Re: Where to log lines go
- Subject: Re: Where to log lines go
- From: Paul Taylor <email@hidden>
- Date: Mon, 12 Jan 2009 18:09:03 +0000
Mark J. Reed wrote:
Paul: log output from osascript goes nowhere. It arguably should go
to standard error or something, but osascript does not handle that
event. If that's all you wanted to know, now you do. Good luck.
Thanks , I'm really suprised by that but so be it
Philip attempted to go further to help you resolve your actual issue,
which seemed to be getting output from your script where your calling
program can access it. Neither AppleScript nor osascript provides
any built-in way to write directly to standard output (or standard
error, or to read from standard input for that matter). The return
value of a top-level script is sent to stdout, but not until right
before osascript exits. Hence Philip's suggestion to use 'do shell
script "echo" ', which is expensive and roundabout but has the
distinct advantage of actually working.
Okay, I didnt want to add another language to the mix so I done what
Philip suggested but using applescript instead by creating a file from
by calling program, then using
set fileref to open for access (POSIX file (get "logFilename") as
string) with write permission
try
...... cmds
on error err_mess
write err_mess to fileref as string starting at eof
log errval
end try
close access fileref
then after the sript has completed my calling program reads from the
logfilename , and adds it to program logs using the correct logging
mechanism.
Paul
_______________________________________________
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