Ignoring response from script called using "run script alias..."

Hello,
I am looking to create a loop in AppleScript that calls a script using the “run script alias” command, and I want ignore the response from it, so it will continue working while the script that called it can continue running - but every time I try either the script is not called, or the script doing the calling must wait. I tried:


tell application "Finder"
	ignoring application responses
		run script alias "HD:Users:userName:Desktop:scriptName" with parameters {theParams}
	end ignoring
end tell

The script does not get called - however, if I remove “ignoring application responses” it will run the script (but ,as expected, will not continue until it is done).


tell me
	ignoring application responses
		run script alias "HD:Users:userName:Desktop:scriptName" with parameters {theParams}
	end ignoring
end tell

This will run the script, but will also not ignore responses and waits for it to finish before continuing.

When I save the script I want to call as an application, I can make it partially work by telling it to run:


tell application "scriptName" 
	ignoring application responses
		run
	end ignoring
end tell

It does run and is ignored, so the calling script can continue, but I cannot pass it parameters doing it this way, and I need to pass it just one parameter.

Any hints or suggestions?

Thanks,
jON bEEBE

Hi,

If you save it as a script app, then you can pass parameters to an open handler. I named this script OpenApp:

on open (t)
activate
display dialog (t as string)
end open

and saved as application. I can use the open handler with this:

ignoring application responses
tell application “OpenApp”
launch
open (“hello”)
end tell
end ignoring
repeat 10 times
beep 1
do shell script “sleep 1”
end repeat

I don’t think you can continue on when using ‘run script’, because the calling app runs the text of the comiled script.

editted

gl,

Wow, kel, this rocks…I did not know of the open handler and parameters. Thanks.

Hi Jon,

You’re welcome.

You can call any user define function, but with the open handler, the script could double as a droplet. For instance you can do this:

ignoring application responses
tell application “DoSomething”
launch
DoSomething(“hello”)
end tell
end ignoring
repeat 10 times
beep 1
do shell script “sleep 1”
end repeat

I’m quite sure that you could also send parameters to the run handler in the past.

gl,