views:

67

answers:

1

I readed some tutorials about making droplets with apple script or with automator's help. First, I need to know if these droplets only works with the drag n drop file action, or if you can do the action in the current directory you are.And if the last answer is yes, how to do with automator? This was a general question.

In my case. I need a droplet in my finder toolbar that when I click on in it search for all file with a specific extensions and drop to trash. I try with automator but I can't fine the action for selecting files in the current directory, only found the general find. Because I will can be in any other possible directory I need to know how to do this. It's not a problem writing some applescript, I don't know it but I can learn:)

+1  A: 

To create a droplet with Automator, you select application, when Automator asks you what you want to create.

The description given by the application, when you select application is the following:

Applications are self-running workflows. Any files or folders dropped onto an Application will be used as input to the workflow.

I think it means that only dropped files / directory will be passed to the workflow. I tested it, and I can confirm it works in that way.

kiamlaluno
so, there is any way to modify the automator script with not drop function, but in the current directory? Which way I have to choose?
Kreker
@Kreker: I looked inside the application created by Automator, and I didn't find any script to alter. You can try creating a script Applescript that finds the files contained in the directory, and passes them to an Automator workflow.
kiamlaluno
In pure Applescript, getting the currently-viewed directory is done with something like this: "set the source_folder to (folder of the front window) as alias". I don't know much about Automator, but I do know you can add custom scripts to a workflow. Perhaps that will help.
Philip Regan
I should say that my answer applies for Mac OS X 10.6, which introduced new Automator features. In Snow Leopard, the input of the workflow is automatically set basing on the type of workflow being created. I remember that in Mac OS X 10.5 the first action to add in the workflow should be the one to select the arguments.
kiamlaluno
Also, the other difference between Snow Leopard, and previous versions, is that in previous versions you decide in which format to save the workflow after you created it; in Snow Leopard, the type of the workflow (and then, in which format it is saved) is decided before to create the workflow.
kiamlaluno