Scripts talking to other scripts

Hi, I am trying to convert Frontier scripts into Applescripts to pass on to clients in an easier format as all Mac come with the ablilty to run these scripts, so i am led to believe. The problem i have is that in the old scripts they can call other scripts and pass parameters which i want to do in apple script. So if anybody knows if it is posible or not. Thank you Mike

You can do this with Handlers.

on test(TheText)
	Display dialog TheText
end

test(“Just a test message”)
If you need to access handlers from another script you need to use ‘load script’
First save the script above as a compiled script.
Then in a new script script:

set ThisScript to load script "The compiled script's Path"
tell ThisScript
	set a to test("Yet more text")
end

From the above example ‘a’ will contain the display dialog result returned from the compiled script.
For further help download the AppleScript Language reference from apples site for a full description on the different methods of calling handlers and scripts

: on test(TheText)
: Display dialog TheText
: end
: First save the script above as a compiled script.
: Then in a new script script: set ThisScript to load
: script “The compiled script’s Path”
: tell ThisScript
: set a to test(“Yet more text”)
: end
I tried this. But I get an when i try to load the first script from the second script saying that “Can’t make some data into the expected type” And it doesn’t work. What’s up with this? Am i doing something wrong?
Thanks!
Ryan

“Can’t make some data into the expected type”
I won’t speak to a universal solution, but that is the error I read when the path name is wrong.
for example:
right path name “hard drive:folder:folder:script”
wrong path name “hard drive:folder:folder:sript”
One typo means a lot.