• 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: Opening text objects to AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening text objects to AppleScript


  • Subject: Re: Opening text objects to AppleScript
  • From: John Nairn <email@hidden>
  • Date: Wed, 10 Sep 2003 16:02:35 -0600

I have not designed the final link to the text yet. What is different
in my app, then in other examples I have seen (and I have not found
many), is that the text accessor methods are in the controller and not
in the NSDocument class that is currently opened to AppleScript. I have
learned to access commands and attributes in the document, but what is
the recommended way to get to accessors in a controller for that
document. Do I need to have the controller as property of the document,
make the controller its own class, etc.? I am looking for an example, I
think, of opening accessor methods that do not reside in the main
document.

The script might go:

tell application "MyApp"
open inputFile
set cmdName to name of front document
tell document cmdName
RunAnalysis -- do come calculations
get text ... -- want to find text in controller of document
cmdName
end tell
end tell


On Wednesday, September 10, 2003, at 02:33 PM, M. Uli Kusterer wrote:

> At 13:17 Uhr -0600 10.09.2003, John Nairn wrote:
>> 3. I would like to "tell" the document to work with both of the text
>> fields in the associated controllers window.
>
> If I understand what you're doing correctly, you're trying to
> AppleScript the View instead of the controller. Which is something
> you're not supposed to do in AppleScript. There is a "GUI scripting"
> extension to AppleScript these days, but it's intended for scripting
> applications that aren't scriptable.
>
> Try rethinking your design. The controller should have accessor
> methods which are used by the text fields. Make those scriptable, not
> the view.
> --
> Cheers,
> M. Uli Kusterer
> ------------------------------------------------------------
> "The Witnesses of TeachText are everywhere..."
> http://www.zathras.de
>
------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page: http://www.eng.utah.edu/~nairn
_______________________________________________
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.

References: 
 >Re: Opening text objects to AppleScript (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Help! Generating an offscreen image for later use in compositing..
  • Next by Date: Re: Newbie question: forcing data format during saveDocumentTo:
  • Previous by thread: Re: Opening text objects to AppleScript
  • Next by thread: Help! Generating an offscreen image for later use in compositing..
  • Index(es):
    • Date
    • Thread