Auto open app when file downloaded via browser

Discussion in 'Mac Programming' started by albebaubles, Feb 28, 2010.

  1. albebaubles macrumors regular

    albebaubles

    Joined:
    Feb 9, 2010
    Location:
    Desert Southwest
    #1
    I'm writing an app that uses a proprietary file extension. The app will successfully open when a file with that extension is double-clicked in finder, but what I would like is for the app to open automatically when a file that the proper extension is downloaded via safari.

    Can anyone shed some light on how to do this? MUST I much around with the DownloadAssessment.plist file, or is there a simpler way for me to do this within my xcode project?

    Thank you very much indeed -- my client really wants this functionality.
     
  2. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #2
    I don't believe there is a way to do this and am very glad of it.
     
  3. albebaubles thread starter macrumors regular

    albebaubles

    Joined:
    Feb 9, 2010
    Location:
    Desert Southwest
    #3
    I know what you mean, and don't disagree in principle - but it makes sense in this case.
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    You could probably use Folder Actions.

    Create a folder action that opens a file with your extension, when that file appears in the folder. Assign the folder action to your brower's downloads folder (which may not be your Downloads folder, if it's been changed in the browser). When Safari has the download in progress, it will be named whatever.download. Only when the file is completely downloaded will it be named "whatever".

    The only other way I can think of to do this is with a browser plugin that recognizes either MIME-type (one you define for your app) or the extension.

    In olden times, most browsers had a way to add "helper apps" that could be opened when a particular extension of a download was detected. Mercifully, those days are largely behind us.
     
  5. albebaubles thread starter macrumors regular

    albebaubles

    Joined:
    Feb 9, 2010
    Location:
    Desert Southwest
    #5
    I thought about setting up folder actions during the install of the app, but to me this is more evil than adding DownloadLoadAssessment.plist file to the user's prefs folder (although, the downloadassessment file doesn't kick in until you've bounced Safari, which is a drag).

    I was hoping I could add LSRiskCategoryExtensions to my info.plist file, but that doesn't appear possible.
     

Share This Page