Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TIProgrammer84

macrumors newbie
Original poster
Jul 8, 2014
2
0
Can someone tell me the purpose of Applescript and the practical applications of learning it?
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
The Land of Hope and Glory
Can someone tell me the purpose of Applescript and the practical applications of learning it?

The purpose is to allow you to automate actions in applications that support Applescript. If you have many repetitive tasks that you want to carry out then maybe using Applescript will allow you to speed up the entire process (assuming the task uses an app that supports Applescript automation).
 

numero

macrumors regular
Jul 23, 2002
106
3
OR
It's a higher level tool that allows you to leverage the abilities of many applications.

Example 1: Say you want to rename a bunch of files. The cumbersome way is to write some C/Obj-C/etc. code that talks with the file system and does the renaming. With AppleScript you can tell the Finder to do it for you.

Example 2: You have a bunch of photos takes on an iOS device. These images are RGB at 72 dpi. You want to convert them to 300 dpi/CMYK compressed TIFF files. You could write some Obj-C code calling Image Kit (or some other language with another image library) or you could realize that Photoshop is pretty good at handling images and let it do the work for you.

In short -- it's a way for automating what would otherwise be a manual workflow by linking together commercial applications. Caveat -- the developer of the application has to have exposed their functions to AppleScript or you have to try your luck at UI Scripting.
 

snorkelman

Cancelled
Oct 25, 2010
666
155
as has been said reptitive workflows, use the tools you've already got to do something neither in itself is capable of doing.

Excel spreadsheet with bundle of stuff I regularly shop for

Stick a Y in the order column of each item I want to buy this time
save the spreadsheet.

Launchd sees the file has been saved and launches an applescript

applescript then generates a set of Reminders grouped by shop, those sync accross cloud to iphone. Done.

Excel cant export reminders, Reminders cant import excel sheets Applescript bridges the gap.
 

et477

macrumors newbie
Jul 10, 2014
6
0
alternative.

learn Xcode. its more advanced and its for mac, iPhone and iPad.
 

Baklava

macrumors 6502a
Feb 1, 2010
569
53
Germany
learn Xcode. its more advanced and its for mac, iPhone and iPad.
Xcode is an IDE, not a language.

What AppleScript is was well described by previous replies. But it's not a generic language I would suggest you to learn as a novice programmer. Instead I would prefer to put languages like C, Objective-C, Java or maybe Apple's own newly released language Swift at the beginning of your learning curve.
 

tkermit

macrumors 68040
Feb 20, 2004
3,582
2,909
Here's what Apple had to say about it in their marketing material, ca. 2001:

Everyone who uses a computer knows how boring it can be to perform the same series of tasks over and over again. For example, try to change the name of every file in a folder containing 75 image files so that all the filenames end with “.TIF” and you soon realize how time consuming and stressful repetitive actions can be. Isn't there a easier way?

Yes, it's called AppleScript.

AppleScript is an English-like language used to write script files which can control the actions of the computer and the applications which run on it.

Scripts can make decisions based on user-interaction or by parsing and analyzing data, documents or situations. AppleScript scripts can speed your work, make actions on your computer more productive and save you time and money.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.