Cynosure.X International LLC

: :

Add Comment | Related Links | TrackBack
Related Content

How to Create and Use AppleScript Libraries

Apple script allows you the user to automate tasks on your computer by using simple commands. These commands are in English and can create both simple and complex scripts that can then be called upon from the library, when you need them. For you to be able to use apple script you must first make sure that the program you are making it for supports the use of scripts. Using the application automator (the icon with the white robot) found in your applications folder under mac osx will allow you to select what application you want to make the script for, automator provides a nice graphical interface that makes it easy to this. You can see the online help available from the automators menu. Using automator is really easy and requires no knowledge of a scripting language, you make workflows to do the tasks you require, and the apple script is created. Lets look at a simple apple script (taken from apples website):

tell application "Finder"
if folder "Applications" of startup disk exists then
return count files in folder "Applications" of startup disk
else
return 0
end if
end tell

This script is written mostly in plain English and will give you the number of files you have in your applications folder. Let's examine the script closer. You will see that in the script it is written IF folder 'applications' exist. So this is a statement that says that only return the amount of files of a folder called applications if that folder exists. All IF statements must then be followed by an else statement. So in the example above we are writing a script that will return the value of 0 if no files exist in the folder or even if the folder itself doesn't exist. Now look at the statement end if. In plain English that doesn't make sense but if you look at the script you can see that you have started a process and that process is called 'if' so we need to tell the computer that you have finished your task, hence we use the statement 'end if' So using this logic you can see why we also have to end the process 'tell' hence the use of the statement 'end tell'

Mac osx also comes with an application called script editer which allows you to edit pre configured scripts or make your own new ones. You can use scripts in many ways to automate tasks that you constantly rpeat on your computer. I hope this article helps you understand more on how to create use apple script libraries. For more in depth information I recommend you check www.apple.com go into the support section and find apple scripts, you will find all the information there to help you.

Appleman
Tue, 10 Feb 2009 18:25:10 +0000

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 10 + 10?
Click button only once, please!

TrackBack

TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.

Send Ping | TrackBack URL | Spam Control

No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.

Messages, files, and images copyright by respective owners.

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

72 Users Online

Hacking Digital Cameras
Fun for Photographers



Amazon Associate

Copyright © 1996 - 2024. All Rights Reserved.