Opening a folder in the Finder from my app

  • Hi everyone,

    I've got an application that uses files stored in it's Application
    Support Folder, in the Library, and want the user to be able to open
    the folder in the Finder from within my application, so that they can
    add files to it easily...

    I've looked through the API References for NSFileManager and
    LSOpenFSRef, and searched the list archives, but cannot find any info
    on opening folders in the Finder from another application. Is there
    any way to do this?

    Thanks for your help,

    Adam Radestock
    Glass Monkey Design Co.
  • NSAppleScript? It's kinda hackey, but if there are no other ways, it
    does indeed work.

    --
    mikey

    On 26 Oct, 2006, at 10:58, Adam Radestock wrote:

    > Hi everyone,
    >
    > I've got an application that uses files stored in it's Application
    > Support Folder, in the Library, and want the user to be able to
    > open the folder in the Finder from within my application, so that
    > they can add files to it easily...
    >
    > I've looked through the API References for NSFileManager and
    > LSOpenFSRef, and searched the list archives, but cannot find any
    > info on opening folders in the Finder from another application. Is
    > there any way to do this?
    >
    > Thanks for your help,
    >
    > Adam Radestock
    > Glass Monkey Design Co.
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/mikey-san%
    > 40bungie.org
    >
    > This email sent to <mikey-san...>
  • I believe NSWorkspace selectFile:inFileViewerRootedAtPath: is what
    you probably want.

    This will open the specified file (or folder) in a Finder window.

    Stephan

    On Oct 26, 2006, at 11:03 AM, Michael Watson wrote:

    > NSAppleScript? It's kinda hackey, but if there are no other ways,
    > it does indeed work.
    >
    >
    > --
    > mikey
    >
    > On 26 Oct, 2006, at 10:58, Adam Radestock wrote:
    >
    >> Hi everyone,
    >>
    >> I've got an application that uses files stored in it's Application
    >> Support Folder, in the Library, and want the user to be able to
    >> open the folder in the Finder from within my application, so that
    >> they can add files to it easily...
    >>
    >> I've looked through the API References for NSFileManager and
    >> LSOpenFSRef, and searched the list archives, but cannot find any
    >> info on opening folders in the Finder from another application. Is
    >> there any way to do this?
    >>
    >> Thanks for your help,
    >>
    >> Adam Radestock
    >> Glass Monkey Design Co.
    >> _______________________________________________
  • Or just -openFile: (passing a folder path) ... NSWorkspace will do
    the right thing.

    --
    I.S.

    On Oct 26, 2006, at 11:13 AM, Stephan Cleaves wrote:

    > I believe NSWorkspace selectFile:inFileViewerRootedAtPath: is what
    > you probably want.
    >
    > This will open the specified file (or folder) in a Finder window.
    >
    > Stephan
    >
    > On Oct 26, 2006, at 11:03 AM, Michael Watson wrote:
    >
    >> NSAppleScript? It's kinda hackey, but if there are no other ways,
    >> it does indeed work.
    >>
    >>
    >> --
    >> mikey
    >>
    >> On 26 Oct, 2006, at 10:58, Adam Radestock wrote:
    >>
    >>> Hi everyone,
    >>>
    >>> I've got an application that uses files stored in it's
    >>> Application Support Folder, in the Library, and want the user to
    >>> be able to open the folder in the Finder from within my
    >>> application, so that they can add files to it easily...
    >>>
    >>> I've looked through the API References for NSFileManager and
    >>> LSOpenFSRef, and searched the list archives, but cannot find any
    >>> info on opening folders in the Finder from another application.
    >>> Is there any way to do this?
    >>>
    >>> Thanks for your help,
    >>>
    >>> Adam Radestock
    >>> Glass Monkey Design Co.
    >>> _______________________________________________
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
    > 40gmail.com
    >
    > This email sent to <idiotsavant2005...>
  • Thanks for the pointers.

    I ended up using [NSWorkspace sharedWorkspace] openFile:
    Just passed the full path to the folder and it opened it in the Finder!

    Thanks again,

    Adam Radestock
    Glass Monkey Design Co.

    On 26 Oct 2006, at 4:13 pm, Stephan Cleaves wrote:

    > I believe NSWorkspace selectFile:inFileViewerRootedAtPath: is what
    > you probably want.
    >
    > This will open the specified file (or folder) in a Finder window.
    >
    > Stephan
    >
    > On Oct 26, 2006, at 11:03 AM, Michael Watson wrote:
    >
    >> NSAppleScript? It's kinda hackey, but if there are no other ways,
    >> it does indeed work.
    >>
    >>
    >> --
    >> mikey
    >>
    >> On 26 Oct, 2006, at 10:58, Adam Radestock wrote:
    >>
    >>> Hi everyone,
    >>>
    >>> I've got an application that uses files stored in it's
    >>> Application Support Folder, in the Library, and want the user to
    >>> be able to open the folder in the Finder from within my
    >>> application, so that they can add files to it easily...
    >>>
    >>> I've looked through the API References for NSFileManager and
    >>> LSOpenFSRef, and searched the list archives, but cannot find any
    >>> info on opening folders in the Finder from another application.
    >>> Is there any way to do this?
    >>>
    >>> Thanks for your help,
    >>>
    >>> Adam Radestock
    >>> Glass Monkey Design Co.
    >>> _______________________________________________
    >
    >
    >
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today