So, for the first try block to fail and the second one to succeed, thePath would need to be an object that isn't a string, but still has a valid path property that can be converted to a string. That is, thePath should be a disk item (a file or a folder), but not a string representing a disk item. To illustrate this, suppose thePath is an actual file object rather than a string representing a file path. In this case, the first try block would fail because thePath as string would not yield a valid file path, but the second try block would succeed because path of thePath would yield a valid file path that can then be converted to an alias.
On May 9, 2023, at 13:38, Gil Dawson via AppleScript-Users <email@hidden> wrote:
I've been reviewing Apple's documentation on files, folders, paths and such. Several examples surprised me. Here is one:
Converting a Path to an Alias
|