Enhance Mac OSX by enabling the Applescript menu and you will have a fast convenient way to access any script for any application. There are some super cool tricks with Script Menu, which I will explain here.

To enable the Applescript Menu, open the application:

Applications > AppleScript > AppleScript Utility.app

and select "Show Script Menu". The Applescript menu icon will appear in the upper right of the screen.

The Applescript menu features an easy way to create custom script folders for the frontmost application.
Click in Finder somwhere so Finder comes to the front. The frontmost application (in focus) always has its own script menu so it is always changing.
Create a folder for the frontmost application by clicking the menu icon, then selecting "Open Scripts Folder", then "Open Finder Scripts Folder". A new empty window will appear ready for you to populate with Applescripts.

Notice that the new folder is created at ~/Library/Scripts/Applications/Finder/. This is the default location of your Script Menu folders for each application.

Upload new attachment "Screenshot_3.png"


While you are in the Applescript folder, open Script Editor and check it out. You can write small applescripts, although Script Editor is very rudimentary.

for example:

tell application "Firefox" to launch

would be a simple script.

You can send scripts to Terminal, which is very convenient to see output. In this example:

tell application "Terminal"
do script "id -un"
end tell

Terminal will always spawn a new window for the command. Execute the same command in in the same window by saying this:

tell application "Terminal"
do script "id -un" in front window
end tell

or shorter yet:

tell application "Terminal" to do script "id -un" in front window

There are many customizable tricks with Terminal, Applescript and shell.


Smiley:

209 page views.

CategoryMacOsx CategoryApplications CategoryApplescript

Computer/Applescript/Menu (last edited 2007-09-29 17:49:10 by bas1-quebec14-1128577966)