• 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
Can I make the CocoAppletAppDelegate script run only?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can I make the CocoAppletAppDelegate script run only?


  • Subject: Can I make the CocoAppletAppDelegate script run only?
  • From: email@hidden
  • Date: Fri, 17 Apr 2015 23:18:07 +0200

Hello. 

I have a really simple setup for a CocoApplet, as all it really does is install a service, which is an AppleScript, which is really run by executing an osa script.

I really plan on removing every handler there is in the AppDelegate except for did finish launching, and I plan on making that look like this:

on applicationDidFinishLaunching:aNotification
try
tell (load script (path to resource "main.scpt" in directory "Scripts")) to run
on error errMsg number errNum
if errNum is not -128 then
display alert "An error occurred while running" message errMsg & " (" & errNum & ")" as critical
end if
end try

end applicationDidFinishLaunching:


I’ll keep this method like this:

on applicationShouldTerminate:sender
return current application's NSTerminateNow
end applicationShouldTerminate:


(The main script already works all right, as run only, question is if I can really rip out all of the other handlers, safely, from  CocoaAppletAppDelegate. It is really intended to be run directly by the user once, to register the service.

So, will it work safely on all occasions, given that the applet will be just a service provider, and can I save the CocoaAppletAppDelegate as run-only?

Thanks.

Tommy/McUsr
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Can I make the CocoAppletAppDelegate script run only?
      • From: email@hidden
  • Prev by Date: Re: OS 10.2.3 Applescript Editor gone.
  • Next by Date: Re: Can I make the CocoAppletAppDelegate script run only?
  • Previous by thread: Re: AppleScript-Users Digest, Vol 12, Issue 175 message 2
  • Next by thread: Re: Can I make the CocoAppletAppDelegate script run only?
  • Index(es):
    • Date
    • Thread