Drag and or ask for file

I have a project that processes some text files that are dropped on it. That all works…with a lot of help from posters here in the forum.

on open some_items
--some script...

So how can I have a pop up file dialog asking for a file IF the script is just double clicked? And then do the open command?

Thanks,
Todd

Here

on open the_files
	-- do script
end open
on run
	set the_files to choose file
	-- do script
end run

Hi,

you can call the open handler directly from the run handler.
the multiple selections allowed parameter is required to get a list


on run
	open (choose file with multiple selections allowed)
end run

on open theItems
	repeat with oneItem in theItems
		-- do something
	end repeat
end open

Thank you guys, I knew it was something pretty simple.

Have a great day,
Todd