Is there any way to simply tell a shell to "return the expanded form of this tilde-abbreviated path"?
I'm trying to modify the 'Open Selection In TextEdit' script that comes with TextExtras into an 'Open Selection' script for use in SubEthaEdit, but I can't get it to work with paths with tildes in them.
The one line in my script (besides the TextExtras stuff) is:
But I just get
Code:
No such file: ~/Pictures
on STDERR from the open tool.
I was thinking of using something like
Code:
xargs -I % open `(tell shell to expand path here)%`
but have no idea how to do that, or if there's a better way.
I don't know if this is an xargs issue, an open issue, or a general shell issue. I think it's open though, since everything works OK when using xargs with another tool, e.g. find.
FWIW, the TextExtras script doesn't expand tildes either, and open gives the same error if I execute open with the path quoted from the command line.
Any help is appreciated, including pointing me on the right track if I'm on the wrong one.