Is it possible to do this in Xcode

Discussion in 'Mac Programming' started by SteveniMac, Apr 18, 2013.

  1. macrumors newbie

    Joined:
    Apr 15, 2013
    #1
    I want to know whether it is possible for Xcode to create any type of application that when opened, it would open a specified file on the desktop. It would also help if you could post the code to do this as well.
     
  2. macrumors 68020

    Comeagain?

    Joined:
    Feb 17, 2011
    Location:
    Spokane, WA
    #2
    Sounds more like AppleScript is what you're looking for.
     
  3. macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #3
    I would just put the file into an AppleScript application bundle and use the Finder to open it with the default application, for example:

    Code:
    set theFile to path to resource "Fake Profile.spx" -- a fake system profile
    tell application "Finder" to open theFile -- open the file using the default application
     

Share This Page