From the category archives:
Applescript
Applescript 103
Applescript 103
Mac Tip #216/12-October-2005
The last couple of Tips have aimed to make you aware of Applescript and how useful it can be for a Mac user. I gave you a small script you could modify to open folders, files, applications and even a web address.
From here it becomes more complicated, but the good news is that many other people have already made scripts that you can use, entirely free of charge.
First up though go to the Applescript folder inside your Applications folder and double click the item called AppleScript Utility. Check the box to Show Script Menu in menu bar. Those are the instructions for Tiger. For older operating systems double click the Install Script Menu item in the Applescript folder.
Now you should see a scroll-shaped icon in your Menu bar. Click on it and you’ll see a list of ready-made Applescripts. They may be inside folders named for the Applications you have installed.
Try connecting to the Internet, opening Safari and choosing one of the scripts under URLs. You should go right to the web page you chose.
Have a good look around that scripts menu. You may find all kinds of handy things you didn’t know existed.
Many software manufacturers and enthusiasts create scripts — just try Googling for what you want. Most scripts come with instructions about how to install and use them.
If you enjoy using iTunes then you’ll find hundreds of very useful scripts at Doug’s AppleScripts for iTunes.
Go ahead: have some fun.
Popularity: 10% [?]
{ No comments yet }
Applescript 102
Applescript 102
Mac Tip #215/05-October-2005
In the last Tip I introduced you to making an Applescript, in order to save time and effort. First you’ll want to save the script somewhere. I have a folder named Scripts in my Documents folder to keep all my Applescripts together.
Choose Save from the File menu and save the script somewhere in the script format. Once saved, you can easily run it — sometimes using other utilities so you can trigger a script of dozens or hundreds of actions with one keystroke.
Now, let’s add some more actions, to make this script truly worthwhile. Add extra commands by putting each one on a new line before the final end tell. The following commands would:
- open a document called TimeSheet.oo3, which is in the clients2005 folder inside my Documents folder. Just repeat the command with the name and path of each document to open.
- open the web pages for Google News (NZ) and MacTips.Info
- open the Dictionary and Mars Edit applications
Here is our new script:
tell application "Finder"
open "Macintosh HD:Users:miraz:Documents"
open "Macintosh HD:Users:miraz:Documents:clients2005:TimeSheet.oo3"
open location "http://news.google.co.nz"
open location "http://mactips.info"
open "Macintosh HD:Applications:Dictionary.app"
open "Macintosh HD:Applications:MarsEdit.app"
end tell
How’s that for handy?
Popularity: 8% [?]
{ No comments yet }
Applescript 101
Applescript 101
Mac Tip #214/28-September-2005
For years now Macs have had the ability to automate tasks by using a feature called Applescript. Now, to be totally honest, my first hundred forays into Applescript were spectacularly unsuccessful and I found it very hard to grasp. Even more frustrating was that it seemed everyone else on the planet thought Applescript was totally straightforward and simple.
For the last few years though I have been making headway with it. I still think it’s not as easy as many claim, but it’s definitely worth investigating if there are things you do repeatedly with your Mac.
One thing I sometimes have to do is open a dozen folders and files for one or other of the projects I work on. This is a big pain; Applescript is perfect for the job.
Open the Applications folder, then the Applescript folder and then double click the Script Editor icon. A blank document will appear. This is where you can type your instructions.
You always need to “tell” something to do something. In this case I’m going to tell the Finder to open my Documents folder. Type the following into the Script Editor, with one change: my username is ‘miraz’ — you need to replace that with your username. Also, if you’ve changed your hard drive name from Macintosh HD then you’ll need to change that part too.
By the way, the speech marks and colons are important, and it needs to span three lines as typed below.
tell application "Finder" open "Macintosh HD:Users:miraz:Documents" end tell
Now go to the Script menu and choose Run (or type Command R or click the Run button on the Toolbar).
Your Applications folder should open. If you use OS 9 instead of Mac OS X then you may have to change the “path” — probably to: “Macintosh HD:Documents” — as I no longer have OS 9 I can’t double check that.
That script isn’t much, is it? But over a few more tips I’ll show you how to add more commands, meaning that eventually you’ll be able to click one button and have your computer do a whole lot of tasks for you.
Popularity: 10% [?]
{ No comments yet }















