O'Reilly logo

AppleScript in a Nutshell by Bruce W. Perry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Standard Additions

Dictionary commands

adding folder items to alias

This is a Folder Action command covered in Section of Chapter 26.

ASCII character integer

This command returns the ASCII character associated with the number provided as a parameter. For example, ASCII character 80 returns the string “P.”

ASCII number integer

You can find the ASCII number of a character by using code, such as ASCII number "P" (this returns an integer of 80).

beep integer

This makes the beep sound integer number of times, or once if a parameter is not included.

choose application

This command opens the choose application dialog box, which only lists the programs running at the moment. Figure A-3 shows this dialog. Figure A-4 shows what this dialog looks like in the OS X release. The following example lists the running applications, then opens the user’s choice. Note that choose application also displays faceless background applications that the user cannot interact with (they can quit some of these apps, however).

The OS 9 choose application window
Figure A-3. The OS 9 choose application window
The choose application window in OS X
Figure A-4. The choose application window in OS X
try -- capture error if they choose a 'background only' app tell (choose application application label "Choose one program"¬ with prompt "Here are the running applications") to activate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required