on idle (* Add any idle time processing here. *) end idle on doScript() set wrappedCommand to ("xemacs" as string) set scriptLocation to ("Contents:Resources:Scripts:launcher.sh " as string) set scptdPath to path to me as string set executionPath to scptdPath & scriptLocation set theShellScript to (POSIX path of executionPath as string) set command to theShellScript & wrappedCommand return command end doScript on run {} set command to doScript() try do shell script command end try end run on open names (* Add your script to process the names here. *) set argList to " " repeat with curPath in names set posixPath to quoted form of (POSIX path of curPath as string) set argList to argList & posixPath & " &" end repeat set command to doScript() & argList try do shell script command end try quit end open