Runnning apps in the backround

Wondering how i could run a script taht gives terminal a command without seeng terminal

(hiding terminal)

The “do shell script” statement does just that, it will run your commands via sh and without opening a terminal window, try this one as an example…

do shell script "date"
display dialog result

oks i did exactly that however the output.txt is never created … here is my code

set temp to display dialog "Please enter your user name (Need the root name for correct pathing)" default answer "Root"
set temp2 to text returned of result
do shell script "nidump passwd . | grep " & temp2 & " > output.txt"
end

it works fine when u have it as

tell application "terminal"
do script "nidump passwd . | grep " & temp2 & " > output.txt"

I ran your first script and it does create the output.txt file. It should be in your root directory named output.txt. Your redirect will overwrite the file each time you run the script, if you use a double redirct “>>” it will append the output.txt file each time you run it.

Your second script will create the output.txt file in whatever directory the terminal is set open at the time you run the script. By default that is the $HOME directory.

Additionally you have a variable named “temp” that is not being called and you are using an “end” statement at the end of the first script that is not needed.

display dialog "Please enter your user name (Need the root name for correct pathing)" default answer "Root" 
 set temp2 to text returned of result 
 do shell script "nidump passwd . | grep " & temp2 & " > output.txt"