2 part question:
I\'m simply trying to run programs using applescript from the terminal, so I tried:
$ osascript tell application \"iTunes\" to activate
In a bash shell (like in Terminal), you can send multiple lines to osascript by using a "here document".
osascript -e "tell application \"iTunes\"" -e "activate" -e "end tell"
becomes
osascript <
As an old-skool Unix hacker, I save these little snippets in my $HOME/bin directory and call them from the command line. Still learning the particulars, though.
Alan