realbasic-nug
[Top] [All Lists]

Re: reveal in finder

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: reveal in finder
From: Joe Huber <joehuber at talasoft dot com>
Date: Sat, 1 Jun 2002 08:12:41 -0700
Cc: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
how do i tell the finder from RB to reveal a file in the finder (open the enclosing folder and select the file)?
i suppose there is some apple event which can do this.

Matthias

Here's how I do that.

Sub MyShowFolder(f as folderitem)
   #if targetwin32 then
dim s as shell
   s=new shell
   s.execute "explorer "+f.absolutePath
#else Dim ae as AppleEvent
   ae = NewAppleEvent("aevt", "odoc", "MACS")
   ae.FolderItemParam("----")=f
   If Not ae.Send Then
      LogMsg "MyShowFolder: Couldn't show folder"
   End if
ae = NewAppleEvent("misc","actv","MACS")
   if not ae.send then
      LogMsg "MyShowFolder: Couldn't Activate Finder"
   end if
#endif
End Sub

Hope this helps,
Joe Huber


<Prev in Thread] Current Thread [Next in Thread>