Dark boy42
Apprentice
Applescript is a scripting language that comes with every Mac. If you ask me, it is one of the best features of it. Here are some useful basics to know, that will make your Mac experience better.
Lets start with making Safari open a basic website. How about, Sythe.org? To do this, open script editor and type:


Run the script and it will open Sythe! If you prefer using Firefox, just replace "Safari" with "Firefox"
Now lets make your Mac say things
Open script editor and type this in:


Run it and watch the magic
You can also display text. Open script editor and type this in:
There are system commands as well. Here are a few that will make turning your mac off and on easier.
Off:
Standby:
Restart:


Lets start building an application, shall we? Let's use what we have learned so far. Type this into script editor:


Congratulations! You have just built your first application in Applescript.
You now know some Applescript basics. In my next guide, i will explain some more advanced features of Applescript.
"This looked a lot bigger writing it."
~Dark
Lets start with making Safari open a basic website. How about, Sythe.org? To do this, open script editor and type:
Code:
tell application "Safari" to open location "http://www.sythe.org/"


Run the script and it will open Sythe! If you prefer using Firefox, just replace "Safari" with "Firefox"
Now lets make your Mac say things
Code:
tell application "Finder" to say "Dark Boy 42 is awesome"


Run it and watch the magic
You can also display text. Open script editor and type this in:
Code:
tell application "Finder" to display dialog "Dark Boy 42 is l33t"
There are system commands as well. Here are a few that will make turning your mac off and on easier.
Off:
Code:
tell application "Finder" to shut down
Standby:
Code:
tell application "Finder" to sleep
Restart:
Code:
tell application "Finder" to restart


Lets start building an application, shall we? Let's use what we have learned so far. Type this into script editor:
Code:
tell application "Finder" to display dialog "Hello there, click OK and Dark Boy 42 will talk to you."
tell application "Finder" to say "Dark Boy 42 says Hi Sythe"


Congratulations! You have just built your first application in Applescript.
You now know some Applescript basics. In my next guide, i will explain some more advanced features of Applescript.
"This looked a lot bigger writing it."
~Dark


