DescubreApple

Apple, Mac, iPhone, iPad

DescubreApple

Learning AppleScript (Part One)

I have the firm intention of learning AppleScript from scratch, so I thought some of you might be interested and that these short tutorials in Spanish might be useful to you.

Keep in mind that I am not an expert, so any correction will be welcome. The goal is simple: to go deeper into this language and leave a guide so that those who come after can follow the path more easily. I hope we can build this guide together, so all collaboration, criticism or suggestions will be welcome.

What is AppleScript?

I think the starting point is knowing what we are going to study and what it will be useful for, so this short introduction is essential for that.

AppleScript is a language created by Apple to automate common, repetitive tasks or save time on complex, long-running tasks. Thanks to the close relationship between Apple and most applications, this language is really powerful; in this way, anything you can do in an application will be recognized by the script editor (most of the time).

Its main features are a clear, natural language (in English), fully functional on OS X systems, and the possibility of running on earlier systems. The default extension of scripts generated with the editor is usually .scpt, but there are exceptions, which we will discuss in due course.

Getting to know the editor:

To develop our future scripts we will need to use the editor Apple provides for this purpose. We can find it inside the AppleScript folder, within the Applications folder.

Botones appleSCript

Its interface is simple at first glance: four buttons: Record, Stop, Run and Compile. Their functions are self-explanatory just by looking at them. To run our script we must compile it using the corresponding button and then run it.

Our first script will be the legendary “Hello World,” but in a spoken version (to make it more interesting).

AppleScript

The code, apart from being short, is simple:

Say "Hello World" using "Victoria"

With the “Say” command we tell it what to say (the hello world is in English because in Spanish it comes out with a very ugly accent). After putting the phrase we want it to say in quotation marks, we use the “using” command to indicate which voice it should use to pronounce it; if we don’t specify one, it will use the default voice.

With this, and a piece of cake, we leave for the next chapter a deeper look into the world of AppleScript and its possibilities.

S
19 comments · Comment

19 comments

  1. Muy interesante. Yo también estaba pensando empezar a aprender a usar Applescript (soy un recin switcher, dos semanitas con mac =P)
    Así que te seguiré de cerca! jeej

  2. Bien!

    Muy interesante! Yo también estaba pensando en aprender AppleScript pero nunca encontraba el momento para ello!

    Os seguiré atentamente!

  3. Me parece muy buena idea ya que por lo general no se habla mucho de los scripts en otros blogs y si repiten las mismas noticias.
    Supongo que habra una etiqueta especial para poder ver todo lo relacionado con los applescripts.
    bien gracias y chido.

  4. buenisimo el tutorial! a este ritmo en unas 200 sencillas lecciones podremos empezar a programar algo 😉

  5. aun sigo sin saber para que sirve el AppleScript,siempre lo había visto y no sabía para que era,aun así gracias por el tutorial 🙂

  6. He de reconocer que este primer cpaitulo era un capitulo piloto, asi que agradezco los sutiles consejos.

    Prometo que el proximo (seguramente serña a principios de semana) será mas interesante y mas largo.

    Y explicare detalladamente para que podemos usar el AppleScript usando ejemplos y propuestas en honor a Luxy y aquellso que se encuentran en la misma tesitura.

    Si teneis mas ideas o sugerencias o criticas por favor no dudeis en comentarlas.

  7. Programo computadoras desde el año 1980, en un surtido variado de idiomas de programacion, estudio lo que se puede aprender sobre programacion y he usado computadores main freen desde aquella epoca y en la actualidad poseo una Mac PowerPc G3 a la que jamas pude hacer algun programa de uso administrativo por no poder poseer un lenguaje, hoy hace 3 dias (30-06-2010) pruebo con Apple Script en Mac Os 8.6 nesecitaria un manual de principiante EXPERTO puesto que con lo poco que encontre ya hice un programa de modelo de prueba, seria practico tener el acceso a bibliotecas de Sistema ya que a la fecha existen un numero muy variado de ellas para uso en aplicaciones. Muchas gracias. 54 years old. Argentina.

  8. Hola AMADEO, haceme el favor de llamarme 155090607, o enviame mil contu telefono y direccion. Saldos Sergio de Cba

  9. Pingback: free game slots
  10. Pingback: Social media news
  11. Pingback: click this site
  12. Pingback: Check This Out
  13. Pingback: dbwatchsoftware
🇬🇧 EN