Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7597305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:07:33+00:00 2026-05-30T22:07:33+00:00

My app is able to extract .deb files but only if you specify where

  • 0

My app is able to extract .deb files but only if you specify where with buttons in the app. But I want to be able to just click on a .deb file and have my app open up, run the actions I already have, then quit when it’s done. Right now I’m using NSWorspace to tell my app it can open .deb files but I don’t know how to have it run my actions from that. Is using NSWorkspace even the right thing to do? I also need to be able to get the Filepath of the file being opened in string format and I can’t seem to fighure this out?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:07:35+00:00Added an answer on May 30, 2026 at 10:07 pm

    I did some testing and this might be of interest to others, too. Solution is lined out by a little example.

    Create a new Cocoa project in Xcode, go to the xib and add a label to the window. We will use it for a proof of concept. Next, some stuff to your app delegate. Interface:

    #import <Cocoa/Cocoa.h>
    
    @interface fileClickerAppDelegate : NSObject <NSApplicationDelegate> {
    NSWindow *window;
    NSTextField *fileName;
    }
    
    @property (assign) IBOutlet NSWindow *window;
    @property (assign) IBOutlet NSTextField *fileName;
    
    @end
    

    The implementation is pretty straight forward:

    #import "fileClickerAppDelegate.h"
    
    @implementation fileClickerAppDelegate
    
    @synthesize window;
    @synthesize fileName;
    
    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    
    }
    
    - (void)application:(NSApplication *)theApplication openFiles:(NSArray *)filenames {
    
        [fileName setStringValue:[NSString stringWithFormat:@"Wow, even multiple files like %d :-)", [filenames count]]];
    }
    
    @end
    

    There is one method to keep an eye on:

    application:openFiles.

    Guess what it does? It receives a list of files passed from either having clicked on an item on the desktop or in the finder, or having dragged files onto the icon. It will be passed an array with the filenames, along with the paths, UNIX style.

    My tests did not require to set “Document types” in the plist of the app, or doing fancy registration stuff with the finder. Of course, this could add…

    That should fix your problem and you can do whatever you want with your .deb files (I assume debian packages?).

    Good luck!

    Living

    P.S.: Just do not forget to hook up the NSTextField to the GUI control 😉 Otherwise, it will work but nothing is displayed….

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that normal users need to be able to run, but
I'm able to complete my iphone app using core data internally. But for the
I have an app that needs to be able use either an sqlite3 datebase
I have an app which could benefit from the user being able to choose
I want to be able to do some profiling to some app using the
I want to be able to use the iPhones Mail.app inside my application so
I have an FFmpeg-based video-playing app which is able to play content from any
i'm having NSMutableArray which containing student info, now i just want to extract student
I'd like to store endpoint configurations in the .config file, but be able to
I want to create an authorization filter for my web app(To be able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.