Re: Using "original item" property on aliases from a network share
Re: Using "original item" property on aliases from a network share
- Subject: Re: Using "original item" property on aliases from a network share
- From: Philip Aker <email@hidden>
- Date: Thu, 25 Jun 2009 02:01:37 -0700
On 2009-06-25, at 00:41:38, Axel wrote:
I wrote a script which give the path of the file pointed by the
alias given as an argument. It works without problem on local
disks. It doesn't work on mounted network shares (AFP). The
exception "File wasn't found" (-43) is thrown.
Is that the expected behaviour ? Is there a way to resolve an
alias on a network volume ?
What happens if you select that file in the Finder, and then from
the Finder's menu bar menu choose "Show Original"?
The original file/directory is shown in the Finder.
Emmanuel's post was quite comprehensive for considerations from
AppleScript. I'm under the impression that for various practical
reasons, AppleScript will always try to resolve the alias directly and
not try to take extra steps to ensure success other facilities do. But
that is not the only way to use the underlying AliasHandle an
AppleScript alias represents. If you are able construct a C language
helper tool (#include <CoreServices/CoreServices.h>), the function
FSCopyAliasInfo() has a CFStringRef *pathString parameter which on
output will contain the POSIX path of whatever the original
AliasHandle held. You say the Finder can correctly locate and show the
original. Then it seems to me it must be possible to get good
information from that alias and the above mentioned pathString would
be my first choice. There is other information returned from
FSCopyAliasInfo to work from as well.
I have no idea why the fnfErr is being reported.
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
Democracy: Two wolves and a sheep voting on lunch.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden