Hi Mike,

Here's a very simple script which can allow some insight. Anything that is a 
string will be always between quotes while anything in a list will be between 
braces. Parens, like logical operations, are used to prioritize one operation 
from another, and they are also used for properties of objects.
If you type two dashes at the beginning of line, the line will be considered a 
comment and not included in the compile. Same for /* and */ where everything 
between will be ignored.



set thevar to text returned of (display dialog "what's your name?" default 
answer "" buttons {"cancel", "ok"} default button 2)
Set your_name to "thevar
Set random_greet to {?hello", "hi", "what's up", "good day"}
Say an item of random_greet & your_name


The english is almost palpable in the script, but you need to get the hang of 
it. And also, get familiar with all the objects in each application's 
dictionary by pressing command shift o within applescript editor.

Here's the script. Broken down by --comments


--start by asking the user something
set thename to text returned of (display dialog "what's your name?" default 
answer "" buttons {"cancel", "ok"} default button 2)
--make or "set" the variables for containment and use
set random_greet to {"hello", "hi", "what's up", "good day"}
set thegreet to some item of random_greet
--return the variables as a spoken sentence
--leave a few seconds to shut up the system voice over
delay 3
say thegreet & thename & ", what can i help you with?"


This is a totally useless script, but there's a lot of grammar and types in 
there, and you can replace stuff around to see how it works.


Hope this somewhat helps 




On 11/03/2012, at 8:57 AM, Michael Malarsie <[email protected]> wrote:

> Hey everyone,
>       There has been a lot of talk about apple scripts but I am bringing it 
> up again.
>       I have done a lot of searching on Google about how it works so I have a 
> very small understanding of that. What I don't get thought is how to actually 
> write them. 
>       I don't understand what needs quotes around it and what needs brackets 
> and so on. 
>       Can someone send me a few scripts of varying difficulty so I can 
> examine how they need to be arranged?
>       I really appreciate any help. Take car!
> 
> Mike Malarsie 
> 
> P.S. Off topic…are there any runners in here? I just ran my first 5k race 
> today after losing my sight. What a rush!! Finished 7th.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "MacVisionaries" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/macvisionaries?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/macvisionaries?hl=en.

Reply via email to