# Alias via GetOpenFolderItem

**URL:** <https://forum.xojo.com/t/alias-via-getopenfolderitem/14155>\
**Category:** General\
**Created:** [February 7, 2014, 4:57pm UTC](https://forum.xojo.com/t/alias-via-getopenfolderitem/14155 "2014-02-07T16:57:54Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [July 9, 2015, 10:43pm UTC](https://forum.xojo.com/t/alias-via-getopenfolderitem/14155/21 "2015-07-09T22:43:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [July 10, 2015, 1:46am UTC](https://forum.xojo.com/t/alias-via-getopenfolderitem/14155/22 "2015-07-10T01:46:49Z")

</div>

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

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

> [@199457:@Michel Bujardet](#):
>
> GetOpenFolderItem

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.

---

<div class="post-metadata">

**Author:** ![Thomas\_ROBISSON](https://forum.xojo.com/user_avatar/forum.xojo.com/thomas_robisson/32/25592_2.png) [@Thomas\_ROBISSON](https://forum.xojo.com/u/Thomas_ROBISSON)\
**Post date:** [July 10, 2015, 7:51am UTC](https://forum.xojo.com/t/alias-via-getopenfolderitem/14155/23 "2015-07-10T07:51:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [July 10, 2015, 8:37am UTC](https://forum.xojo.com/t/alias-via-getopenfolderitem/14155/24 "2015-07-10T08:37:57Z")

</div>

> [@199474:@Sam Rowlands](#):
>
> Have you tried creating an instance of OpenDialog, it has more options on it than GetOpenFolderItem.

Good idea, but it resolves the alias as well.

> [@199512:@Thomas ROBISSON](#):
>
> Then it seems the change is between Carbon and Cocoa.

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.

---

<div class="post-metadata">

**Author:** ![Thomas\_ROBISSON](https://forum.xojo.com/user_avatar/forum.xojo.com/thomas_robisson/32/25592_2.png) [@Thomas\_ROBISSON](https://forum.xojo.com/u/Thomas_ROBISSON)\
**Post date:** [July 10, 2015, 8:39am UTC](https://forum.xojo.com/t/alias-via-getopenfolderitem/14155/25 "2015-07-10T08:39:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [July 10, 2015, 8:51am UTC](https://forum.xojo.com/t/alias-via-getopenfolderitem/14155/26 "2015-07-10T08:51:31Z")

</div>

[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.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:04pm UTC](https://forum.xojo.com/t/alias-via-getopenfolderitem/14155/27 "2020-10-29T17:04:13Z")

</div>



[Previous page](https://forum.xojo.com/t/alias-via-getopenfolderitem/14155.md?page=1)
