• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to find the file (url) that was double-clicked to open my Cocoa Application?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to find the file (url) that was double-clicked to open my Cocoa Application?


  • Subject: Re: How to find the file (url) that was double-clicked to open my Cocoa Application?
  • From: Alex Zavatone <email@hidden>
  • Date: Wed, 30 Mar 2016 15:16:21 -0400

I see in your original email that you say you pass info on to a script.

Which method in your app is it calling?  In iOS when I use a URL to launch our app it uses application: openURL: and the URL is passed in as an NSURL

// Open/activate the app while activated through a URL
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {


I know I'm speaking from the iOS perspective, but could your app call a URL to open the app when the installer script completes?

It could then pass the arguments on to the app through the URL?

It looks like it's possible and there are samples for how to do this online.

http://fredandrandall.com/blog/2011/07/30/how-to-launch-your-macios-app-with-a-custom-url/

Would that work for you?


On Mar 30, 2016, at 9:06 AM, Jonathan Mitchell wrote:

>
>> On 30 Mar 2016, at 06:47, Motti Shneor <email@hidden> wrote:
>>
>> Hi Everyone.  My issue is tied to a very specific scenario, but still a Cocoa question.
>>
>> I write a custom Installer Plugin (code bundle), used to customize our installations (done via Mac Installer). The plugin bundle is loaded at some arbitrary time by the Installer App. It needs access to the actual package file on disk.
> Can the required package resources not be copied as part of the installation?
> Could the actual package not have been deleted by the time the bundle runs?
>
>>
>> The Installer application logs (in /var/log/install.log) its actions and near to the start, it emits the following line:
>>
>> Mar 30 07:47:54 CyberMotti Installer[19943]: Opened from: /Users/motti/Documents/Projects/MyTestLogDistribution/build/MyTestLogDistribution.pkg
>>
>> Which contains exactly the info I need. Furthermore - at a much later stage of the installation, when the Installer runs some install-scripts I wrote, the Installer supplies this information also in the first argument sent to the scripts.
> Can one of the scripts not cache this path for you to consume later?
>
> J
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >How to find the file (url) that was double-clicked to open my Cocoa Application? (From: Motti Shneor <email@hidden>)
 >Re: How to find the file (url) that was double-clicked to open my Cocoa Application? (From: Jonathan Mitchell <email@hidden>)

  • Prev by Date: Re: Strange Delay
  • Next by Date: Re: Strange Delay
  • Previous by thread: Re: How to find the file (url) that was double-clicked to open my Cocoa Application?
  • Next by thread: Re: How to find the file (url) that was double-clicked to open my Cocoa Application?
  • Index(es):
    • Date
    • Thread