no dialog focus while installer is running

I can’t seem to get the dialog from the applescript that is being called by Installer to have focus once it is run. The dock item for Finder will jump and the dialog will not be displayed unless the dock item is clicked. I would like the dialog to be displayed on top of installer when it is called. The applescript is saved as an application and works fine if it is run standalone. It only appears this way if it is being run by Installer. Any thoughts would be appreciated. Thanks.

tell application "Finder"
	if (the folder "Macintosh HD:Applications" exists) then
		tell application "Finder"
			make new alias file to ("Macintosh HD:Applications:CPS:CPS.app") at desktop with properties {name:"CPS"}
		end tell
	else
		display dialog "An alias was not created on the Desktop because the Hard Drive has been renamed from the default \"Macintosh HD\". 
		
To create an alias on the desktop for CPS:
1.Browse to the Applications folder.
2.Open the folder labled CPS.
3.Single click on the file labeled CPS.
4.Click on \"File\", then \"Make Alias\".
5.Drag and drop the alias to the desktop." buttons "OK" default button "OK" with icon stop
	end if
end tell

You have the dialog request going through tell finder, not coming directly from your script.


tell application "Finder"
	set itExists to false
	if (the folder "Macintosh HD:Applications" exists) then
		set itExists to true
	end if
end tell

if itExists then
	tell application "Finder"
		make new alias file to ("Macintosh HD:Applications:CPS:CPS.app") at desktop with properties {name:"CPS"}
	end tell
else
	display dialog "An alias was not created on the..." buttons "OK" default button "OK" with icon stop
end if

Would the “Activate” command help?


tell application "Finder"
	activate
	if (the folder "Macintosh HD:Applications" exists) then
		tell application "Finder"
			make new alias file to ("Macintosh HD:Applications:CPS:CPS.app") at desktop with properties {name:"CPS"}
		end tell
	else
		display dialog "An alias was not..." buttons "OK" default button "OK" with icon stop
	end if
end tell

I haven’t tested either… just guessing.

That did the trick. I thought that I would only be able to create a dialog through telling Finder. Thank you for the informative reply.