• Log in or sign up for an account here: https://www.sythe.org/login

Applescript Basics

Dark boy42

Apprentice
Joined
Aug 26, 2007
Sythe Gold
0
Messages
973
Location
Va-jay-jay Town.
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:

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 :) Open script editor and type this in:

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
 
Very nice, I heard you talk about this earlier and I was really looking forward to this. Perhaps you can show us how to use a mouse clicker using applescript?
:]
 
:] Can't wait,
 
Very basic scripts but cool i guess. They are looking for scripts so this guide should work for you =].
 
Runescape Gamblingrunescape gambling
Back
Top