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

Emilio454

macrumors newbie
Original poster
Jan 1, 2008
10
0
I use applescript to do apps but the thing is that i don't know how to use it :s
Can someone please make me a tutorial please?

Thanks, Emilio.
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
You're joking, right? AppleScript is a huge subject. You are basically asking for someone to teach you how to be a programmer. That's like saying "Please make me a tutorial on how to be an airline pilot." It's not going to happen. Start with some books, such as AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X. There may also be a few online tutorials to help get you started, such as those on the MacScripter site, but it's not something you can learn overnight.
 

Macgenie

macrumors newbie
Jan 8, 2008
14
0
Suffolk, UK
I use applescript to do apps but the thing is that i don't know how to use it :s
Can someone please make me a tutorial please?

Thanks, Emilio.

Hi Emillio - as stated, Applescript is a BIG topic and can be hard to get on with - it can be very much a case of trial and error and poring over dictionaries to see what can be done. You need to have a good idea of what you are trying to achieve and then break it down into small steps - some scripters do amazing things with Applescript but if you want to really get to grips with a Mac I would suggest you learn Cocoa & Objective C instead.

I have included a short script below which automates the clearing out of Appleworks alias files (every time an Appleworks doc is opened it creates an alias - as these build up Appleworks tends to get slower and slower so every now and then it pays to trash the alias files. My code:

tell application "Finder"
make new Finder window
tell application "Finder"
activate
move every file of folder "Recent items" of folder "Starting Points" of folder "AppleWorks User Data" of folder "Documents" of folder "XXXXXX" of folder "Users" of startup disk to trash

end tell
close Finder window 1
end tell

Note - replace "XXXXXX" with the name of your Mac account for this to work.

Even this short piece of code took some time to work out; Applescript is not very intuitive and the dictionaries take some getting used to, the syntax can seem strange at times and not all applications respond to Applescript fully.

Hope this helps :)
 

dstearns96

macrumors member
Dec 16, 2007
54
0
do a command+F search in finder and narrow it to script types. here is a visual. open some of these and take some code from them and put it together to make something, you can learn from these things
 

Attachments

  • Picture 2.jpg
    Picture 2.jpg
    77.6 KB · Views: 79
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.