REALbasic: Opening a file in finder

Discussion in 'Mac Programming' started by mahaboob, Sep 24, 2008.

  1. macrumors member

    Jul 10, 2008
    Hi all,
    I'm new to REALbasic. I have one staticText and one button. staticText contains the path like: Mac Mini HDD: Library: Fonts: Chalkboard.ttf. When I clicking the button I need to open a browser to the actual location of the path with the file (Chalkboard.ttf) as selected. How can I do this ?

    I tried it like this
    Dim f as FolderItem
    Dim fname as new FileType
    fname.Name= me.txt_path.Text
    fname.MacType = "TFF"
    fname.Extensions = ";"
    f= GetOpenFolderItem(fname)
    But it selects only the Font folder not the Chalkboard.ttf
    How can I solve this?
    Thanks in advance
  2. macrumors 6502a

    Sep 3, 2005
    Cramlington, UK

    FileTypes are used to specify what file types the dialog is interested in, eg .jpg, .txt etc. You can't specify the default file with them. If you want to specify a default file for the dialog I think you need to use the FolderItemDialog class.

    By the way, I think you will get more help posting over on this forum.

    b e n

Share This Page