Make my own terminal app

Hello.

I want to make an application for people who aren’t very computer savvy, so that they can perform useful terminal commands at the click of a button. The thing is, I want the shell window to be inside my applescript studio app!

Is there a way that I can do this? Any help, large or small is most appreciated.

Lambo

Hi,

Terminal is scriptable. e.g.

tell application “Terminal”
launch
activate
do script “ls” in window 1
end tell

gl,

Yes, I know that :mad:

I think what I’m really looking for is how to print the results of “Do shell script” to a text box. How do I do that? That seems fairly simple.

set shellOutput to (do shell script "your shell command that returns some text") as Unicode text
set contents of text field "textFieldName" of window "windowName" to shellOutput

Hi Lambo,

If you’re starting from scratch, then you should read the documentation. If not, then what are you stuck on?

gl,

I’ve got to this:


on clicked theObject
	if name of theObject = "scan" then
		set shellOutput to (do shell script "sudo tcpdump -i en1") as Unicode text
		set contents of text field "textFieldName" of window "windowName" to shellOutput
	end if
end clicked

But because when you run that shell script in the terminal, it updates constantly and never ends, my app just loads forever. How can I make the little window refresh constantly just like the Terminal one does?