Apple - Get AppleScript Path of Parent Folder

AppleScript is written in English. Read what it says! Remove the posix path of from the code, and you'll get the HFS path.

Full code:

tell application "Finder" to get (container of (path to me)) as text

Try this:

Unix style:

set my_POSIX_path to POSIX path of ((path to me as text) & "::")

If you need to pass it to e.g. shell script, you might want to enclose the path with quotes:

set my_POSIX_path to quoted form of POSIX path of ((path to me as text) & "::")

macOS style:

set my_path to (((path to me as text) & "::") as alias) as string

Then depending on your needs, replace set my_path to / set my_POSIX_path to with display dialog or just return.