set theFolderPath to "~/Pictures/APOD ƒ/"
set theFolderAlias to alias POSIX file expandTildePath(theFolderPath)
set theFolderPosixFile to POSIX file expandTildePath(theFolderPath)
set theFolderPosixPath to expandTildePath(theFolderPath)
tell application "Finder"
set theFile1 to (choose file default location theFolderPosixPath) # Works fine (on 10.9.5).
# set theFileX to (POSIX file (expandTildePath(theFolderPath) of me)) # The Finder doesn't like it!
set theFile2 to (choose file default location theFolderAlias) # Works fine.
set theFile3 to (choose file default location theFolderPosixFile) # Works fine.
end tell
------------------------------------------------------------------------------------
on expandTildePath(posixPath)
if posixPath = "~/" then
set posixPath to POSIX path of (path to home folder)
else if posixPath starts with "~/" then
set posixPath to (POSIX path of (path to home folder as text)) & text 3 thru -1 of posixPath
end if
return posixPath
end expandTildePath
------------------------------------------------------------------------------------