Finder windows are different from other windows used by the Finder application, in that they display the contents of folders and, may contain a Toolbar and Sidebar. The remaining script examples of this chapter we will use the term Finder window instead of the generic term window when referring to Finder windows. The Script Editor application icon. A script window in the Script Editor application. A tell statement is composed of two parts: A reference to the object to be scripted, and The action to be performed.
Here's our first script: A simple script statement to close all open Finder windows. Delete the previous script from the script window, then enter, compile, and run the following script: A script to open the hard drive that contains the currently running System folder. The first step in working with a script, of course, is opening it up.
Fortunately, this is an easy process: just double-click the script in the Finder. At this point, you can click the Run button to see what the script actually does in this case, the script opens a new Finder window and takes you to the Applications folder.
The next step in working with a script, of course, is understanding how the script actually works. Luckily, the commands in the New Applications Window script are all pretty simple:. If you already have the Applications folder open, this command simply brings that window forward.
The Script Menu, simple as it may seem, has a number of completely hidden tricks up its sleeve. All these shortcuts can save you time, annoyance, and confusion:. Click any submenu to jump right to that folder in the Finder. For instance, if you wanted to open up the Mail Scripts folder, you could just click on the Mail Scripts submenu of the Script Menu. Shift-click any script to jump right to it in the Finder. Presto—the new name now shows up in the Script Menu. Option-click any script to open it in Script Editor.
Once there, you can examine the script to see how it works, or edit it to change how it works. Either way, Chapter 2 has more details on Script Editor. Add files besides scripts to your Scripts menu. Yes, you read that right. Using this trick, you can turn your Script Menu into a fast, free application and file launcher.
If you do, the menu may spend minutes burrowing into your folders, trying to figure out how to display all their items. Now that you understand how the script works, you can change it to better suit your needs. Replace Applications with Users. Click the Run button to test your script. Name the file New Users Window. Open your Script Menu, and run your new script from the Navigation Scripts submenu.
If you did everything correctly, your new menu item opens the Users folder in the Finder Figure Skip to main content. Start your free trial. Chapter 1. Setting Up AppleScript. Figure The Script Menu. Address Book Scripts. Note The scripts in the Helper Scripts submenu just above Import Addresses are off-limits to mere mortals. The Script Menu is your key to running AppleScripts from just about any program. To move the Script Menu to a less clip-prone position, simply -drag its icon farther to the right.
Finder Scripts. Note A faster way to minimize all your Finder windows is to simply Option-click the yellow minimize button in any single Finder window. The hard way to add these extensions is to rename each file by hand top. Note You can accomplish the same task by Option-. Loading page content. User profile for user: pinkstones pinkstones. Reply Helpful Thread reply - more options Link to this Post. Mar 23, AM in response to pinkstones In response to pinkstones That is the first problem Mar 23, AM in response to pinkstones In response to pinkstones All the usual stuff - about 20 or so apps.
User profile for user: Allan Jones Allan Jones. Thanks for your time I told you it was called Script Editor and where you could find it in my initial response to you. Ask a question Reset. Active Oldest Votes.
Improve this answer. Script Editor. Tommy Tommy 1. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta.
0コメント