Today's adventure was
working with some simple Automator Workflows and AppleScripts to help Finder
tasks in OSX.
First it's useful to remind
ourselves where these objects go:
Various useful scripts can
be found in these subfolders:
A copy of "New
Applications Window.scpt" from /Library/Scripts/Navigation Scripts/ was
moved to ~/Library/Workflows/Applications/Finder and then compiled and saved as
"New Applications Window.app".
An alias of this was then
renamed to "Start" and placed on the desktop. Here is the script:
tell application
"Finder"
activate
open
folder "Applications" of the startup disk
end tell
Another useful script is
this one to close all Finder windows:
tell application
"Finder"
close
every information window
{}
close
every window
{}
end tell
To run your scripts, first
you use the AppleScript Utility to enable the option "Show Script Menu in
menu bar" for AppleScript.
Then when you are in Finder you will get a drop-down context-sensitive menu
which includes the system scripts as well as Finder scripts you have created
yourself.
Useful additional Finder
workflows can be created by simply copying some of the sample AppleScripts into
Automator "Run Applescript" workflow objects.
Once tested in Automator and
saved, your workflows have to be manually moved to
~/Library/Workflows/Applications/Finder, but then they are available as
additional actions when you are in Finder. To access them, you press the Control key and click mouse
button 1 in a Finder Window (ylou can also use mouse button 2 if you have it).
You can then click on "Automator" to see a list of workflows you have
created.
I created workflows to open
my Home, Documents, and Applications folders, together with others to create a
new text file, to create a new sub-folder, and to provide an easy-to-use Finder
navigation menu. The last one used
"Open Special Folder.scpt" from /Library/Scripts/Navigation Scripts.
Enjoy!
From http://m06orama.blogspot.com/ 2007-03-01
OSX-Automator-2.html