set falias to ((path to desktop folder as text) & "Some Folder") as alias
set falias to ((path to desktop folder as text) & "Some File.txt") as alias
on GetAliasContainer(theAlias)
set finfo to info for theAlias
set txdl to text item delimiters
set text item delimiters to ":"
if (folder of finfo is true) then
set dirstr to text items 1 thru -3 of (theAlias as Unicode text)
else
set dirstr to text items 1 thru -2 of (theAlias as Unicode text)
end if
set text item delimiters to txdl
(dirstr as text) as alias
end GetAliasContainer
GetAliasContainer(falias)