![]() Let’s see whether we can use the properties of the browser window to control where the window appears on the screen. Tell application "Safari" to open location ""Ī new browser window containing the specified Web site is displayed. Next, let’s use the open location command to open a Web page with the following script (assuming your computer is connected to the Internet). As with the scripts you used with the Finder, note that this script is a tell statement containing the necessary two elements: a reference to the targeted objects (in this case the open browser windows) and the action to be performed (close). ![]() Tell application "Safari" to close every windowĪny open browser windows in the Safari application are immediately closed. After it has finished starting up, enter, compile, and run the following script in a new script window in Script Editor. In a new Finder window, navigate to your Applications folder, and launch the Safari application. Let’s see whether that statement is indeed true. As stated earlier in this chapter, the principles used in those scripts apply to all scriptable applications, not just the Finder application. In learning to apply these principles, you wrote scripts to control the appearance of Finder windows in the Finder application by accessing and changing the values of their properties and by using standard verbs, such as close and open, to control their display.
0 Comments
Leave a Reply. |