• 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
Scriptable application startup behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scriptable application startup behavior


  • Subject: Scriptable application startup behavior
  • From: Fabrizio La Rosa <email@hidden>
  • Date: Sun, 25 Jan 2004 18:26:12 +0100

Hello,
I am trying to add AppleScript support to a document based Cocoa application for the first time, hence maybe that the following question could seem trivial to others.
The usual scripting support implementation problems should to be solved (I hope) by the more exhaustive documentation about this argument included in the latest Xcode Tools.
My problem is that the application could be launched by three kinds of event, but I don't know how it can be aware of the latter of these events:
- it is launched "as is", hence a "Untitled" document is created and its window is showed (this is its default behavior because I actually return YES in the applicationShouldOpenUntitledFile: NSApplication delegate method).
- it is launched to open a saved document, hence that document's window is showed
- it is launched by an AppleScript that tells it to perform some tasks, starting from the data contained in a saved document.
In the latter case the application must open the document to parse its data but no window controller has to be created, so that the associated window is not showed.
I have seen that there is a NSApplication delegate method named openFileWithoutUI: that could do the trick, but I don't know how and when to handle it.
For your information, the application is built following the Cocoa guidelines, so it has a NSWindowController subclass to manage all the GUI outlets, actions and methods, a NSDocument subclass that acts as the document controller and model object, a NSApplication delegate in a separate subclass and a subclass of NSObject that is the "task performer".

Thank you, Fabrizio
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Cocoa from the command line?
  • Next by Date: Re: NSMovie to/from NSData
  • Previous by thread: Example Project Cocoa-MySQL
  • Next by thread: Disabling Exposé for some windows, some day =3 F
  • Index(es):
    • Date
    • Thread