Hello!
I have a small shell script that takes a single argument, appends it to a text file, and passes it to an applescript that displays a growl notification.
Instead of appending this to a text file i would love to have a simple application that will display what the shell script (or applescript) passes to it in realtime.
my desired result is to have a single window that appends (without user intervention) with the values that my script(s) pass to it.
any ideas/insight is enormously appreciated.
-aeol
AppleScript: 2.2.1
Browser: Safari 7536.26.17
Operating System: Mac OS X (10.7)
Hello.
I guess you can use what I wrote in This post.
It is all about setting up a named pipe, the idea is as follows.
You have opened a terminal window somehow, there, (or somewhere else, but up front) you have created a named pipe.
So you start cat “the named pipe” in that window, effectively echoing whatever you are sending.
Because in the other part, where you are passing arguments, you pipe these through the tee command, where the named pipe is the file aregument, and after that, you redirect the arguments you still have on your stdout into applescript or whatever.
I hope this helps, and if it is anything you are wondering about, I’ll help you. find this exciting!
How about using the console.app? As the name suggest it’s an great tool to display log results.
- create an log file
- open log file with console.app
- append data to the file
Console will update the contents of the file to the screen.
Hello.
I think DJ Bazzie Wazzie is right about using the Console, after all, it was made for it.
Here is a handler, to let you pass your arguments from AS, into a file with a name you specify, that you then can open from the sidebar in Console.
You can also have the log window come forward, whenever there is an updated, by looking at the preferences pane of Console.app
to logit(log_string, log_file)
do shell script ¬
"echo `date '+%Y-%m-%d %T: '`\"" & log_string & ¬
"\" >> $HOME/Library/Logs/" & log_file & ".log"
end logit
Edit
But if the OP wants to see his arguments, passing by, line by line in a terminal window, while the script executes, I’m all for it!
Thanks for the wonderful input McUsrill and DJ Bazzie Wazzie! I tip my hat to you both.
I will try your suggestions in a bit and edit this post when i have something working.
-aeol