?
Solved

Finder Get Info

Posted on 2000-04-10
2
Medium Priority
?
337 Views
Last Modified: 2013-12-26
How can I get the Finder to display the Get Info window for a document from an FSSpecPtr to the document? Any suggestions?
0
Comment
Question by:dwp090598
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
roov earned 400 total points
ID: 2703074
You need to send the Finder an appleEvent, requesting for it to display the GetInfo box.

Below is the code, which MUST be called after initializing the Mac toolbox...

Enjoy,
Reuven

do {
      OSErr                  err = noErr, err2;
      AEAddressDesc      finderProcessDesc;
      OSType                  finderProcessSignature = 'MACS';
      AppleEvent            finderAEvent, finderAEventReply;
      AEDescList            docList;

      // Get Finder's process desciptor
      err = AECreateDesc(
                  typeApplSignature,
                  (Ptr)&finderProcessSignature,
                  sizeof(finderProcessSignature),
                  &finderProcessDesc);
      if (err != noErr)
            break;
      // Create AppleEvent to Finder
      err = AECreateAppleEvent(
                        kAEFinderEvents,
                        kAEGetInfoSelection,
                        &finderProcessDesc,
                        kAutoGenerateReturnID,
                        kAnyTransactionID,
                        &finderAEvent);
      // Plugin the file spec
      // This is a three step process:
      // 1. Prepare an AEList
      // 2. Plugin the file spec into the list
      // 3. Plugin the list into the AEvent
            // 1. Prepare an AEList
      err = AECreateList(nil,0,false,&docList);
      if (err != noErr) {
            // We could/should perform the test right after AECreateAppleEvent,
            // but since the bailing is the same...
            err2 = AEDisposeDesc(&finderProcessDesc);
            err2 = AEDisposeDesc(&finderAEvent);
            break;
      }
            // 2. Plugin the file spec into the list
      err = AEPutPtr(&docList,1,typeFSS,&fspec,sizeof(fspec));
      if (err != noErr) {
            err2 = AEDisposeDesc(&finderProcessDesc);
            err2 = AEDisposeDesc(&finderAEvent);
            break;
      }
            // 3. Plugin the list into the AEvent
      err = AEPutParamDesc (&finderAEvent,keyDirectObject,&docList);
      if (err != noErr) {
            err2 = AEDisposeDesc(&finderProcessDesc);
            err2 = AEDisposeDesc(&finderAEvent);
            break;
      }

      // Send the event of it's way...
      err = AESend(
                        &finderAEvent,
                        &finderAEventReply,
                        kAENoReply,
                        kAEHighPriority,
                        kAEDefaultTimeout,
                        NULL,
                        NULL);
      // Cleanup...
      err2 = AEDisposeDesc(&finderProcessDesc);
      err2 = AEDisposeDesc(&finderAEvent);
} while (false);

0
 

Author Comment

by:dwp090598
ID: 2709637
Thanks the  kAEGetInfoSelection worked for me.

Thanks Again
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question