I decided to learn a little bit about Applescript & Automator...
I wrote my first script to start the Terminal and write some commands in it
tell application "Terminal"
do script " cd /Users/joss/Sites/rails/test/ ; script/server"
end tell
it's simple but 2 Terminal windows are open.... why ?
so many google info on Applescript, where is the best tutorial for a
beginner trying just to write so simple scripts ?
thanks
joss
J. Stewart - 12 Oct 2006 09:30 GMT
> I decided to learn a little bit about Applescript & Automator...
> I wrote my first script to start the Terminal and write some commands in it
[quoted text clipped - 4 lines]
>
> it's simple but 2 Terminal windows are open.... why ?
Terminal's preferences are set to open a window when launched, "Do
Script" automatically opens a new window instance when run unless...
tell application "Terminal"
do script " cd /Users/joss/Sites/rails/test/ ; script/server" in window 1
end tell
This tells Terminal which window to run the script in so it has no need
to open its own window instance.
> so many google info on Applescript, where is the best tutorial for a
> beginner trying just to write so simple scripts ?
Sign up for Apple's Applescript mailing list.
<http://lists.apple.com/mailman/listinfo/applescript-users>
The usenet Applescript News Group is
<nntp://alt.comp.lang.applescript>
Here's some good places to start looking for info on Applescript -
<http://en.wikipedia.org/wiki/Applescript>
<http://www.apple.com/macosx/features/applescript/resources.html>
Here's a couple of tutorals
<http://www.applescriptsourcebook.com/>
<http://www.macobserver.com/tips/applescript/>
J

Signature
Use ROT-13 for email address
Josselin - 12 Oct 2006 10:13 GMT
>> I decided to learn a little bit about Applescript & Automator...
>> I wrote my first script to start the Terminal and write some commands in it
[quoted text clipped - 37 lines]
>
> J
Thanks a lot... I'll look at these links
patrick j - 12 Oct 2006 22:11 GMT
> where is the best tutorial for a beginner trying just to
> write so simple scripts ?
I see that some excellent links have been provided for information.
If you are interested in a book then you might like to check out Hanaan
Rosenthal's "AppleScript".
This book assumes no knowledge but is very comprehensive indeed.

Signature
Patrick
Brighton, UK
Bob Harris - 13 Oct 2006 02:48 GMT
> I decided to learn a little bit about Applescript & Automator...
> I wrote my first script to start the Terminal and write some commands in it
[quoted text clipped - 11 lines]
>
> joss
It is NOT necessary to tell the terminal to run a shell script
from Applescript. For example, the following is a drag & drop
apple script that processes each file dropped on the Applescript
via a shell script
on open filelist
repeat with i in filelist
do shell script "my_command " & quoted form of POSIX path of i
end repeat
end open
This little Applescript will execute the shell command
my_command a_filename
for each file dragged and dropped on this Applescript. Notice,
there is no 'tell' involved.
my_command can be any shell command, and can be a sequence of
shell commands separated by ; or it can be a shell script.
Also the terminal does not launch.
Of course if you want to have some output displayed on the
terminal, then this will not work for you.
Bob Harris