Re: Writing To A File
Re: Writing To A File
- Subject: Re: Writing To A File
- From: Doug McNutt <email@hidden>
- Date: Tue, 30 Sep 2003 13:10:56 -0600
At 12:30 -0500 9/30/03, Steve Mills wrote:
>
On Tuesday, Sep 30, 2003, at 11:32 US/Central, Paul Berkowitz wrote:
>
>Look, Steve. The Standard Additions Dictionary says:
>
>
>
>open for access file -- the file or alias to open for access. If the file
>
>does not exist, a new file is created.
>
>
>
>See that "file"? It's required. It's not optional. It's not a bug that you
>
>have to write 'file' or 'alias' (which is coerced to 'file' when it exists
>
>already). It's part of the command. If you don't like that, too bad. It's
>
>not negotiable.
The problem is one of coercions. AppleScript does a lot of that and it's quite difficult to know which ones are automatic, which ones need to be asked for, and which ones won't work at all.
Elsewhere in this thread there was a dictionary entry that mentioned "long integer" as a numeric type. AppleScript doesn't do any such thing. It uses a floating double or "real".
Most of the undocumented coercions can be understood by experimentation but it's the kind of thing done by experienced programmers and not by the people that Apple says AppleScript is for. In the world of Apple advertising It's for the same users who are told "You don't have to read the ( ) manual; the OS is designed to be the ultimate in user friendliness." MacroMaker was a start at a user-oriented scripting system. If AppleScript could only rediscover that kind of simplicity it would be something for users.
If it's true that AppleScript is intended to be used only by paid programmers it should drop the charade of multi-word commands where it's never obvious if, as in the case above, the word file is a class designator for what follows or is a part of the command itself. Is "application" part of the tell command or is it a class designator for coercion of the text string that follows? Those paid programmers would be better off with a more succinct syntax and they are capable of understanding an actual header file for the class. Is there any such thing? Has anyone published a Baccus-Naur syntax description for AppleScript?
open -a BBEdit $HOME/.tcshrc
is pretty simple compared to the AppleScript equivalent which is likely to involve coercing a Finder alias before the file can be opened. And, there is no problem with a pathname as text.
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.