Re: Soliciting opinions from Applescript refugees

2004-02-28 Thread John Delacour
At 1:08 am -0600 28/2/04, Chap Harrison wrote:

Here's a language that thinks (to name but one flaw) that zero or 
one things can't comprise a list of things.
Without wishing to make too ardent a defence of AppleScript, I would 
say that a little experience will show that it's not quite as stupid 
as you propose.  As to Filemaker, I'm delighted to say I've no 
inclination to examine its doubtful assets.

set ls to  as list
repeat with i in ls
beep
end repeat
set ls to {}
repeat with i in ls
beep
end repeat


Re: Soliciting opinions from Applescript refugees

2004-02-28 Thread Doug McNutt
At 01:08 -0600 2/28/04, Chap Harrison wrote:
I am about to switch away from Applescript -- either that, or go mad.

Welcome to perl. You will be pleased.

It involves loading a Filemaker database.

I'm sorry for you. When Filemaker allows me to prepare a macro - er script - with a 
text editor I might try it again. The idea that one is required to mouse around to 
make things work is a disaster. You can't even copy and re-use something you did 
previously in another database.

My major use for AppleScript has been to make drag and drop applets which are usually 
one liners that simply pass a file to perl or perhaps an ANSI-C coded UNIX executable. 
There is a way to put a perl script in a *.app package which can be run from Finder 
but I haven't yet figured out how to pass arguments.

A problem with scripting applications with other than AppleScript is obtaining the 
information you need about the structure of the target application. The dictionaries 
are bad enough in the script editor and you may find it even harder in perl. Just 
finding the codes that are the meat of AppleEvents can be impossible. perl will 
not fix problems with Filemaker or its documentation.

Become aware of BBEdit worksheets. They work well with perl. It's almost like MacPerl 
under MPW. You can store command lines that you use regularly in a worksheet. Then 
just select and execute with the enter key or - in my case - the right mouse button.

And by the way. . . perl can evaluate  $y = -$x^2 and get the right answer.

-- 

Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.


Re: Soliciting opinions from Applescript refugees

2004-02-28 Thread Joel Rees
On 2004/02/28, at 0:08, Chap Harrison wrote:

... and I wonder why some people swear by Applescript.  I think it may 
be from inexperience.
Yours or theirs?

(heh.)

As has been pointed out, FileMaker is still more of a RAD tool than a 
solutions tool, and AppleScript also. Precision in a language is a 
requirement in contradiction with ambiguity, ergo, flexibility.

I think a large part of Perl's success is the ability to go from a 
relatively flexible syntax to a relatively precise syntax within the 
same language. (As opposed to Java, for example, where precision can't 
be escaped, but is relatively uncluttered by language artifacts, or 
SQL, where you have to escape the language to get precision in all but 
a few business contexts.)

I think I agree with John and Doug, your best approach is to expect to 
use multiple tools, which is why mailing lists are useful.



Re: Soliciting opinions from Applescript refugees

2004-02-28 Thread Chris Nandor
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Chap Harrison) wrote:

 Thanks for writing - it sounds like your expectations are similar to 
 mine for application development tools.  For databases in particular, I 
 may start looking into mySQL as an alternative.  For other apps, if 
 their AppleEvents interface can be divined, I will give Perl 
 appleevents a try.

Mac::Glue makes it relatively easy to do it, especially if you have some 
experience with AppleScript.  Taking your original psuedocode, here's the 
untested Mac::Glue equivalent:

   use Mac::Glue ':all';
   my $fm = new Mac::Glue 'FileMaker';
   my $handles = $fm-obj(
  records  = whose(field = 'price', equals = '*'),
  database = 1
   );

   for my $handle ($handles-get) {
  # do something
   }

For more info on Mac::Glue, you might want to see the recent article on 
perl.com.

   http://www.perl.com/pub/a/2004/01/23/macglue.html

-- 
Chris Nandor  [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/