I'm wondering a little, ok much, why we have so many Applescript threads here. After all the section is titled "Mac programming" not "mac scripting" or "automatisation".
So would you say it'S bad style to NOT support AppleScript in own applications? I plan to provide scripting but in Python, Javascript or Lua (whatever gets easier to embed).
Scripting is programming.
mini:~\> cat foo.c
#include "stdio.h"
int main() {
int counter = 0;
while ( counter <= 9 ) {
printf( "Hello world - %i\n", counter );
counter++;
}
}
mini:~\> cat foo.sh
#! /bin/sh
counter=0
while [ $counter -le 9 ]
do
echo "Hello world - $counter"
counter=`expr $counter + 1`
done
mini:~\> cc foo.c -o foo
mini:~\> ./foo
Hello world - 0
Hello world - 1
Hello world - 2
Hello world - 3
Hello world - 4
Hello world - 5
Hello world - 6
Hello world - 7
Hello world - 8
Hello world - 9
mini:~\> chmod 700 foo.sh
mini:~\> ./foo.sh
Hello world - 0
Hello world - 1
Hello world - 2
Hello world - 3
Hello world - 4
Hello world - 5
Hello world - 6
Hello world - 7
Hello world - 8
Hello world - 9
Well I consider scripting is to programming what doodling is to drawing. Mostly it's bad throw away code.
Well I consider scripting is to programming what doodling is to drawing. Mostly it's bad throw away code.
That's not what I meant. Scripting code normally is just a solution for a simple task. Error handling, general usability and good design of the code is seldom.
That's not what I meant. Scripting code normally is just a solution for a simple task. Error handling, general usability and good design of the code is seldom.
Coder's choice. It's not inherent. A good programmer will employ all of those features (if appropriate to the task at hand).
So you write scripts really with full error handling and general usability instead of simple throwing together the code barely needed for the automation wanted?
For scripts? I still have to see a single script in my life that would at least contain useful error handling.
Although it may be possible to create a useful application in Applescript with a purpose that is not automation from scratch, it would be a bit of an odd choice in my opinion.
I'm wondering a little, ok much, why we have so many Applescript threads here. After all the section is titled "Mac programming" not "mac scripting" or "automatisation".
AppleScript tends to make you jump through all kinds of hoops and perform all manner of gyrations to get much of anything done, so some of those doodles wind up turning into genuine works of art. And then there is that infinite number of monkeys thing...Well I consider scripting is to programming what doodling is to drawing.