AppleScript by Mark Conway Munro
Author:Mark Conway Munro
Language: eng
Format: epub, pdf
Publisher: Wiley
Published: 2010-06-14T16:00:00+00:00
Working with Standard Additions
The Standard Additions package contains dozens of very useful commands. To get started, open the AppleScript Editor and choose Library ⇒Window from the menu. Then, double-click Standard Additions to see the library of commands shown in Figure 16.1.
Figure 16.1
The Standard Additions library of commands
User Interaction
The User Interaction suite of the Standard Additions package provides basic commands for interacting with a user. These enable you to ask a user to choose a file, folder, and other items as well as provide feedback to users or ask a question.
Beep
Perhaps the simplest command in AppleScript, beep enables you to make a script user's computer beep. The sound he hears varies based on which sound he chose in his System Preferences. To use this command, simply place it at the appropriate position of the script, typically before an error dialog box or some other event that you want to be sure they take notice of.
If you want the script to beep more than once, put an integer after the command causing it to beep that many times. For example:
beep 2
Typically, you shouldn't have too many beeps in your script, and when you do, one to three is usually enough at any single location. Use a single beep before a dialog box appears that requires the user's attention. Reserve two or three beeps for notifying the user of a serious error or issue that demands more attention than a simple dialog message.
Choose application
The choose application command enables a script to prompt the user to select one or more applications that are installed on the computer or on the network. This command is useful when a script needs to send a command to one of several applications, depending on the user's choice. The basic command, choose application, displays a dialog box containing all of the available applications, as shown in Figure 16.2.
When the user selects an application, the result is an application object:
application “Adobe Photoshop CS4”
Figure 16.2
The Choose Application dialog box
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Filmora Efficient Editing by Alexander Zacharias(5760)
The Infinite Retina by Robert Scoble Irena Cronin(5229)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(3963)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3932)
Edit Like a Pro with iMovie by Regit(3410)
Linux Administration Best Practices by Scott Alan Miller(2858)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2835)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2520)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2387)
Docker on Windows by Stoneman Elton(2317)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2312)
Creative Projects for Rust Programmers by Carlo Milanesi(2231)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2107)
Hands-On Linux for Architects by Denis Salamanca(2051)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(2004)
Computers For Seniors For Dummies by Nancy C. Muir(1996)
The Old New Thing by Raymond Chen(1940)
Linux Kernel Debugging by Kaiwan N Billimoria(1762)
