Get components (path and filename) of POSIX filepath Given:

~/Desktop/Foo.scpt contains:

(POSIX path of (path to me)) as text


Which returns:


  /Users/[username]/Desktop/Foo.scpt


How do I get path /users/[username]/Desktop/ and the file name Foo.scpt as individual pieces?
Just ask Finder he knows how to do it :) 

tell application "Finder"
     set parentpath to POSIX path of (parent of (path to me) as string)
     set filename to name of (path to me)

     display dialog parentpath
     display dialog filename
 end tell