(* Copyright Mark Hunte 2006.Info for this script can be found here. http://www.macosxhints.com/article.php?story=20060403083841944*) on open the_selection tell application "Finder" set The_Path to the_selection set The_Path to item 1 of The_Path set the_name to displayed name of The_Path set cont to read the_selection set the_tag to "applescript://com.apple.scripteditor?action=new&script=" set the_script to the_tag & cont open location the_script tell application "Script Editor" set name of window 1 to the_name end tell end tell end open