Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Get filename using Nav Services Open Dialog

Get filename using Nav Services Open Dialog
Thread Tools
Junior Member
Join Date: Jul 2002
Location: Australia
Status: Offline
Reply With Quote
Jul 28, 2002, 08:37 AM
 
I have a small simple Carbon program, and when you go to the file menu and select open it brings up an NavChooseObject() dialog. After the user selects the object I want to printf() the object filename.

</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">void Open_Dialog()
{
NavDialogOptions dialogOptions;
NavReplyRecord Reply;

AEDescList Filename;

NavGetDefaultDialogOptions( &amp;dialogOptions );

NavChooseObject ( NULL, &amp;Reply, &amp;dialogOptions, NULL, NULL, NULL );

Filename = Reply.selection;
}</pre><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Now I know I have to use AEGetDescData(), but I don't know how.... can anyone guide my please.
     
Fresh-Faced Recruit
Join Date: Aug 2002
Status: Offline
Reply With Quote
Aug 6, 2002, 10:50 AM
 
Syphor,

Try AECountItems() to get the number of items in the AEDescList. You can then iterate through the list and call AEGetNthPtr() to get the FSRef for the file. Lastly, call FSGetCatalogInfo() to get the file name for the FSRef,

Let me know if you need more info on this. The NavServices docs should show you an example.




- josh jacob



Originally posted by Syphor:
I have a small simple Carbon program, and when you go to the file menu and select open it brings up an NavChooseObject() dialog. After the user selects the object I want to printf() the object filename.

</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">void Open_Dialog()
{
NavDialogOptions dialogOptions;
NavReplyRecord Reply;

AEDescList Filename;

NavGetDefaultDialogOptions( &amp;dialogOptions );

NavChooseObject ( NULL, &amp;Reply, &amp;dialogOptions, NULL, NULL, NULL );

Filename = Reply.selection;
}</pre><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Now I know I have to use AEGetDescData(), but I don't know how.... can anyone guide my please.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:15 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2