• 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: Code Completion suggestion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Code Completion suggestion


  • Subject: re: Code Completion suggestion
  • From: has <email@hidden>
  • Date: Wed, 27 Oct 2004 11:15:04 +0100

Phill Smith wrote:

I don't see why the script editor can't read and parse the text of the
script, find the application or script object references then taking
information from the tell block of from th e apostrophe notation.
Interrogate the dictionary or the script objects and come up with a
list of elements and properties.
There may be a speed problem but I don't see why there is a technical
problem. It may require a more structured script using tell blocks or
apostrophes but thats  OK

Speed is a non-issue because, as has already been said, there are serious technical problems:


1. There is insufficient type information available in the source code, e.g.:

    tell application "TextEdit"
        set myRef to document 1's text
        ...
        get myRef's ?????
    end tell

So there's no way to know what type of value variable myRef contains except by executing the code.


2. There is inadequate information in the application dictionary, e.g.:

    tell application "Finder"
        get home's folder 1's entire contents's ?????
    end tell

I had to drop a major user-friendly feature from appscript because of this limitation. Very frustrating.


The primary problem is that while it's easy to implement the kind of feature you describe in a statically typed language where the every variable's type can be determined in advance, it'll be virtually impossible to do with any kind of reliability for a dynamically typed language, where a variable's type isn't known until runtime. The best you could get is a guessing system that sort of sometimes works in a few limited situations if you handle it with kid gloves and don't look at it funny and there's a 'T' in the day of the week, etc. And having a "help" system that works badly tends to be worse than not having it at all.


On the other hand, there are good, reliable ways of doing 'dumb' autocompletes (to save typing) and application object model browsing (to aid learning). So it would make much more sense and take far less work to implement those, and play to the language's strengths rather than its weaknesses.

has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Code Completion suggestion
      • From: Phill Smith <email@hidden>
  • Prev by Date: Re: Native AS or grep via do shell script?
  • Next by Date: Open Files for Illustrator
  • Previous by thread: Re: Code Completion suggestion
  • Next by thread: Re: Code Completion suggestion
  • Index(es):
    • Date
    • Thread