I just discovered this, by looking at the man page for osascript.
From 10.4, you can now pass parameters to scripts run with oscascript. From that page:
Any arguments following the script will be passed as a list of strings
to the direct parameter of the ``run'' handler. For example:
a.scpt:
on run argv
return "hello, " & item 1 of argv & "."
end run
% osascript a.scpt world
hello, world.
Cool!

