Alias via GetOpenFolderItem

You are probably just fine with your AppleScript. From what I see, the biggest issue is that no matter what, GetOpenFolderItem resolves the alias. The only way to go around this would to roll a custom file picker which provides the parent folder as well as the picked FolderItem. Possible with a listbox and a couple buttons…

A file picker that does not resolve aliases may be possible with declares, though.

There’s two types of Alias I’m aware of.

#1 Symbolic links.
#2 Bookmarks (which can also be security-scoped bookmarks).

Have you tried creating an instance of OpenDialog, it has more options on it than GetOpenFolderItem.[quote=199457:@Michel Bujardet]A file picker that does not resolve aliases may be possible with declares, though.[/quote]
I seem to recall that there is an option with a NSOpenDialog, but these are trickier to implement as they now use Blocks, you may want to look at the MBS plugin.

I think my program did what I wanted in the past (select the True item with OpenDialog), then I just made the test:
With RealBasic 2012.2.1.0 (last version for Leopard) build Carbon, OpenDialog opens the TRUEitem, it doesn’t resolve the Alias.
With Xojo 2013.3.3.0 (last version for Snow Leopard) build Carbon, OpenDialog opens the TRUEitem, it doesn’t resolve the Alias. But it resolve in build Cocoa.

Then it seems the change is between Carbon and Cocoa.

Good idea, but it resolves the alias as well.

Lots of things have changed between Carbon and Cocoa…

Since it works in AppleScript, I am sure there must be an option in the framework to pick aliases instead of target. In pure Xojo, what I posted works, but requires knowing which directory the pick will happen. It is possible with InitialDirectory, but there is no way to know if the user decides to change folder. So a custom file dialog would be the solution.

I have no idea how the open dialog is called in the Cocoa framework, but I suspect some guru will find a native solution.

One more thing, I can’t select with OpenDialog an Alias without Target.
In my case, I made an Alias of a compiled script (application), then I remove it (the application script). I can’t select its alias.

[quote=199516:@Thomas ROBISSON]One more thing, I can’t select with OpenDialog an Alias without Target.
In my case, I made an Alias of a compiled script (application), then I remove it (the application script). I can’t select its alias.[/quote]

Makes sense, since that dialog resolves aliases. No target, no item.