Re: Creating a folder on the desktop
Re: Creating a folder on the desktop
- Subject: Re: Creating a folder on the desktop
- From: Bill Briggs <email@hidden>
- Date: Tue, 6 Sep 2005 23:22:44 -0300
At 12:17 PM -0700 9/6/05, Matt Neuburg wrote:
>On Tue, 06 Sep 2005 16:35:39 +0200, patrick machielse <email@hidden>
>said:
>
>>I'm an AppleScript newby, and this kind of thing really makes me
>>loose faith in AS. I never felt this frustrated before when learning
>>any real programming languages
>
>I hate to say this, but have you considered reading a book? It needn't be
>mind;
Is there no "mind" in your book? ;-)
>this isn't an ad, it's a bit of pedagogical advice. AS *is* a real
>programming language; that's the problem. If you don't know the language,
>it's kind of hard to use it. m.
Oooo, I think you're on thin ice here Matt. I'd never take that statement as gospel. Real programming languages - let's take assembler, C, C++, or even Fortran as an example - have a fixed syntax that you can rely on to work every time in every situation. AppleScript is not at all like that, and you know it's not. That's why it took you so much longer to write the book than you originally thought. If I recall correctly, you said so in public. It took time to pound through it because it wasn't consistent. You had to sort stuff out that just didn't make sense. Did I misunderstand you or is that about what it was like?
The example in question, the difference between Finder and System Events syntax to construct a new folder, shows just how it's NOT like a real programming language. The required syntax changes based on the whim of the application developer (or the fact that what Cocoa frameworks provide basically sucks). There's no control, no clearing house for good behaviour, and you get all manner of nonsense. I've worked through enough trashy AppleScript implementations in the last 8 years to know it's not at all as well mannered as real programming languages. Get AppleScript to cough up a file name for a FrameMaker file and then tell me it's consistent.
I don't want to start a war about whether or not scripting is programming or not - that's something I just don't care about. Depends on how you define programming and scripting. And I'm not dissing AppleScript. I use it all the time to make my life easier, to make money, and to help people. But it's the very nature of AppleScript - that fact that it provides inter-application communications - that makes it impossible to nail down a rigid and consistent syntax. Each developer has the opportunity to make as big or as little a mess of it as he or she wishes.
Faced with a new dictionary for a new application for which you have no documentation you know exactly what you have to do. You experiment, because you have only educated guesses about what will work and what won't. And you get surprises. And in Cocoa applications you get more than you would have before. AppleScript implementations are not in any way consistent - not even the ones from Apple, who should be setting the standard. So the OP's problem with System Events is understandable. I recall the day Apple shipped the first version of Mail. I sat in the San Francisco hotel that evening trying to port some of my Eudora scripts to Mail and going mad. I shouldn't have had to make any new object "at the end of" anything. But this was what, in the end, I had to do. Not that Eudora is the poster girl for good AppleScript implementations, it has its own unique set of oddities that also demonstrate my point, but it's not the dog's breakfast that Cocoa applications like Mail were in early incarnations.
I have a lot of sympathy for new scripters. What seems like it should be simple is often a hair pulling exercise. Those of us who have been at it for a while have learned to cope, but it's not because of the uniformity of AppleScript, it's because we've fallen in the potholes, we know the tricks, we have a trimmed our set of assumptions and are good at shrewd guessing. But it sure as hell is not because AppleScript is like a real programming language (with apologies to Clinton, though "it depends on what you mean by 'real' ").
- web
_______________________________________________
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