run script errors

Greetings all, I’m trying to call one script from another one while passing a variable (a list of file specifications) to second script. I’ve tried sending the files one at a time, as a single list, as files, as aliases(sp?), and as strings. I keep getting this lovely:
“Finder got an error:Can’t make some data into the expected type”
Here’s the command line that I’m using to call the script:

run script "disk:desktop folder:name of script" with parameters current_item

And the beginning of the called script starts with:

on run(current_item)

I’ve also tried to put alias and file in front of the script specification, but that doesn’t seem to make any difference.
Any ideas?

The problem was that the same code that worked for me in OS 8.6 did not work in OS 9.0. If I recall correctly, I had to figure out a way to make it work in 8.6 and before then when we went to 9.0 I had to rewrite the code to maike it work for 9.0. Since the script is being used on both operating systems I created the portion of code shown earlier which accounts for the differences.

Did this make sense?

Andrew Herzog

It makes sense, though I don’t see the problem under 8.6 myself. Just like AppleScript: works perfectly exactly when you don’t want it to… :wink:

Can’t say I see any problems under OS8.6:

run script (file "Mac HD:test script") with parameters {"hello world"}

What troubles did you see?

Is your ‘run script’ line within a ‘tell application “Finder”’ block? Try moving it outside the tell block. (Always be careful who you’re telling…)

I have no problem with:

run script (file "disk:desktop folder:name of script") with parameters current_item