Saving Text Output from Terminal as Variable
Hey guys I know that running commands in terminal is overcomplicating things, but I need to know how to save the output from a Terminal command as a text variable. This is the first script I tried...
---------------------------------------------------
do shell script "cd downloads/example"
do shell script "..."
do shell script "..."
set savedresult as result
display dialog savedresult
---------------------------------------------------
For some reason the shell script couldn't locate the file "downloads/example" when it was clearly there
So I resorted to using Terminal to run the exact same commands which worked fine.
----------------------------------------------------
tell application "Terminal"
activate
set problem1 to do script "cd downloads/example"
do script "..." in problem1
do script "..." in problem1
set savedresult to result
display dialog savedresult
---------------------------------------------------
The problem with this is that I get this error...
error "Can’t make «class ttab» 1 of window id 347 of application \"Terminal\" into type text." number -1700 from «class ttab» 1 of window id 347 to text
So I'm stuck here and need some info on how to fix either of these problems. Thanks for any help you provide.
S
MacBook Pro (15-inch Late 2008), Mac OS X (10.7.4), AppleScript