# Just what is Apple Script?



## nmm88 (Jan 8, 2004)

Ive heard a lot of things about this thing called Apple Script, which im sure all of you here know a ton about. It sounds intriguing, and i would like to know more about what it is, how to use it etc. Any info would be helpful! Thanks!


----------



## neuby (Jan 8, 2004)

...an extreemely powerfull scripting addition to the MacOS. It has been around for several OS generations (Started in OS 7).

With it you can automate virtually all Finder tasks, and control many applications.  Depending on the level of Applescript support within an app, you can do most of the things the application does automatically.

Applescript is a programming language, that is very 'high level' - ie it looks and sounds close to normal english.  (As opposed to 'low level' languages that look and sound like computer code).

If you just want to get started, check out:  http://www.apple.com/applescript/

Good luck.


----------



## loom001 (Jan 9, 2004)

I am also a Noob to applescript and have found the Book Teach Yourself AppleScript in 24 Hours by Sams to be an excellent book for those of us just starting to play in the world of applescript.  hope that helps!


----------



## Urbansory (Jan 9, 2004)

There are a lot of online resources. Applescript is very powerful, currently i made a few that... Run cron scripts (daily, weekly and monthly maintenance on my G4), sometimes i turn on my iTunes to AIM that i wrote about 2 years ago... this takes the current song and places it in my AIM away message, along with a nice formating to make it seem like a "Now playing...." I have folder actions to backup files to different partitions (still working out bugs), a custom AIM away message, dependent on who the person is, i can leave specific messages. Scripts to put my system to sleep from my cell phone (phone sends a email that triggers a script from Entourage, that does this or that)... and a few other mini scripts that I was curious about.

Just read up on it, and try to make something, the more you play around with them, the better scripting them you will get. Almost forgot, I made a Bot for AIM. Although it was triggered by keywords, that didn't work to well, because if that word came up in a chat session, it would automatically prompt the user with "Welcome to Urbansory, Please enter your inquiry.... " It kinda freaked a few buddies out, so i turned that one off.


----------



## michaelsanford (Jan 9, 2004)

Another side-note about AppleScript + voice commands: you can write an AppleScript called, say, "shut down please" with the code (tell application "Finder" to shut down) and place it in the speakable commands folder. Then speak to your computer something like "Victoria, shut down please." {bing} and your computer will shut down, or perform whatever code you put into the AppleScript...

You can do anything with AppleScript.

My personal favourite is its use in XCode, since there's no way I'm going to learn Obj-C in this lifetime


----------



## Urbansory (Jan 9, 2004)

If i had a remote control home, i would seriously try to Applescript it, considering the software could run on X to talk to the home. A X home, that would be tight, use those voice commands that michaelsanford mentioned. I can definitely see myself working on that on the weekends, driving my family crazy.

I guess the first thing i need to complete would be iTunes in my car. I'm going to make a custom interface, use some applescripts, and somehow build or use a old G3 ibook to bring MacOSX into the car. I want a in dash display, touch screen will be so nice, but a majority of this projects budget goes to the new Chevy engine, big rims, killer paint job, and replacing the power hole.

i really want to get into XCode, I've been wanting to make a menu extra for the longest, just so i can learn how. Because me learning another language, such ac C, is just not going to happen.


----------



## symphonix (Jan 9, 2004)

Another nice bit of AppleScript is Folder Actions, which reappeared in Mac OS 10.2 after being absent since 9.2.2. Basically, these trigger a script when you do something to a folder. For instance, I've got one that uses GraphicConverter to create a preview icon for any picture that gets saved to my "Scans incoming" folder.


----------



## Urbansory (Jan 9, 2004)

I'm not sure whats wrong with the folder action i wrote, works fine outside the folder action trigger, but when i drop a file into the folder, i don't get my copy on my Back-Up partition.


----------



## symphonix (Jan 10, 2004)

Urbansory said:
			
		

> I'm not sure whats wrong with the folder action i wrote, works fine outside the folder action trigger, but when i drop a file into the folder, i don't get my copy on my Back-Up partition.



In the folder actions script folder, there is a script called "Enable Folder Actions", you have to run this to turn the Folder Actions system on.


----------



## Urbansory (Jan 10, 2004)

I did that, it's a coding mistake on my part i have yet to look deep into yet.


----------

