Passing values to an on run handler in another script

Suppose I have a one-line script in a run handler that says: ‘display dialog a & space & b’, where a and b are to be supplied by another script calling this one [call it Message]. I can save it as an applet, or as a script.

I want to send values of a and b to “Message” from a second entirely separate script. How do I do that?

Several of the references I’ve ‘googled’ have not worked.

OS X 10.4.7

Here is what I would recommend…

Script one…“Message”

on run
--nothing needed here
end run
on displayMessage(a,b)
display dialog a&space&b
end displayMessage

Script two…

tell application "Message"
displayMessage("First Item", "Second Item")
end tell

I hope this helps!
Dave

Try something like this Adam.

“Message”:

on run {a, b}
	display dialog a & space & b
end run

Calling script:

set {text1, text2} to {"Hello", "World"}

run script (choose file) with parameters {text1, text2}

set test to {"Hello", "World"}

run script (choose file) with parameters test

Thank you both. Shai1, your script hangs on my machine with an error message, but yours works Bruce. Thank you.

Adam