TrueItem versus Item oddity

Thanks to Grandpa @Tim Hare I know know the difference between Item and TrueItem in a FolderItem. However, now that “I” can tell the differences, it appears that there are situations where the FolderItem doesn’t.

If I look at an Item and it is an alias, I check TrueItem. However, it looks like if the TrueItem is missing, the TrueItem points back to the Item. Is this correct? Is there an error that I should be noticing if I try to get the TrueItem and it’s gone? I just created my self a pretty nasty recursion situation.

Well, seeing as TrueItem is only for Mac OS X and you probably don’t want an infinite loop on that alias, you could always check if TrueItem = Item and if they are the same then you can skip processing it further…

I think you’ve got them backwards. TrueItem is the alias. Item is the file the alias points to.

Tim solved this one for me a few weeks ago.

If ‘originalitem’ is the Folderitem in question then the following statement gets to whatever the alias points to.

if originalItem.Alias then originalItem = GetFolderItem(originalItem.NativePath)

I’m not sure why it works but, at least on Windows, it does.