Opening (Choose Application)

Hello again everybody,

 I (unfortunately) had taken a break from ASOC and seemed to forget everything! After regaining a little bit of my knowledge by looking at the source codes of my previous applications, I found an app that I was working on but never finished. The missing piece of the puzzle I am trying to substitute with a choose application command, but it doesn't work. Here is the piece I am trying to fix: 

on run
set randomVar to (choose application with prompt "My Prompt")
display dialog randomVar
end run

Could anyone look past my forgetfulness and help me fix this simple problem?

Thanks,
TechExpertHD

Ahh, I have found the answer. I am very sorry that I’ve made an irrelevant post that I answered in 5 seconds! If you want to know, here was the answer:


	on applicationWillFinishLaunching_(aNotification)
		set randomVar to (choose application with prompt "My Prompt")
		display dialog randomVar
	end applicationWillFinishLaunching_

But you posted the reply which is useful to all. Didn’t know about this handler. :wink: