Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Need help with folder action

I have a folder action set up to open movie files in a conversion app but every time I add a new file it loads all the files in the folder. How can i exclude a file that has already been opened by the folder action. I can't move the file due to queing up moves for conversion if the file is moved after it is opened the the program doesn't know where to look for it. Any idea's. Ive tried Filter finder items by last opened and set it as today but that did not work. It opened nothing. May I could set it up to know if the file has been there longer then 5 min that the folder action should not open it. Thanks for your help.


This is for OS X 10.7.4

Mac Pro, Mac OS X (10.7.3)

Posted on May 29, 2012 5:33 PM

Reply
18 replies

May 29, 2012 5:50 PM in response to Tomfoolery82

You'll need to attach your script so we can see what you are doing to comment on it.


The folder action should only be sending the files that have been added. The basic template for folder actions is:


on adding folder items tothis_folderafter receivingthese_items


-- insert actions here

end adding folder items to

this_folder will have the name of the folder the action is attached to and these_items will have the new files added to the folder.


But again seeing what you are doing will help figure out what the problem is.

May 29, 2012 6:21 PM in response to Tomfoolery82

if there is a better way to do it please let me know bassically i want to only open the movie file nothing else in a conversion program and trash all the rest of the files. everything i have set works execpt say 123.avi is in the folder and the folder action takes place it opens 123.avi in the video converter. if I add and new file ABC.avi to the folder the folder action opens 123.avi and ABC.avi I want it to know that 123.avi was already opened so it does not open them again.

May 29, 2012 8:45 PM in response to Tomfoolery82

Your Folder Action doesn't work because it completely ignores the folder in question and uses the 'Find Finder Items' action to locate specific files - all the 'Folder Action' element is doing is firing off your action when the folder is changed (e.g. a new file is dropped in it), but it's not reacting to the changes itself.


Instead, you should set your Folder Action to respond to the folder, along with a filter to identify the movies:


User uploaded file

May 30, 2012 5:12 AM in response to Tomfoolery82

As Camalot wrote what you have there isnt a folder action. When you start Automator you're give the choice of what template to use to write you Auomator script. You need to choose the Folder Action


User uploaded file

Once you've selected that you can set the folder you want the action to act on


User uploaded file


Then you can add the actions to just act on the files added to the folder.


good luck post back if you have anymore questions.


BTW mentioning that you were using Automator in your first post would have been helpful as I assumed you were doing this in Applescript. And it is always a good idea to include your code so we can see what it is you are doing.


regards

May 30, 2012 10:21 AM in response to Frank Caggiano

That is exactly what I did. In camelots post he saying something about not use find finder items first just use filter items. I tried that first and no results show up in Automator. Actually for several folder actions I have I had to use find finder items first then filter to get any result. I used the folder action like your are showing and selected a folder where you have it circled but if I do not use find finder items nothing happens

May 30, 2012 10:35 AM in response to Tomfoolery82

That is exactly what I did.

What is this referring to? Are you saying you selected Folder Action as the template in Automator? If you did then something want very because in the screen shot of your Automator workflow the folder selection bit isn't there.


Try it again and make sure you have the folder selection pulldown at the top of the workflow.


Here is an example of a workflow that is attached to my Desktop and puts a green label on files added to the desktop by screen capture.




User uploaded file

Try something simple (like this) to start with just to get a feel for how this works.


Message was edited by: Frank Caggiano

May 30, 2012 12:05 PM in response to Tomfoolery82

Are you saving the folder action from Automator? Is the action attached to the folder you think it is? (right click the folder and select Folder Actions Setups to se the actions and the folders attached)


Have you tried to create the action I showed (or something similarly simple)? Does that work?


But nothing happens unless I use find finder items first. I don't get it I thought making the selection your talking about basically already does the find finder items right

By using Find Finder Items you're basically defeating the purpose of the folder action. You're right by specifying the folder in the header the files added to that folder should be passed to the first action as the workflow I showed does.


Again try creating what I showed and see it you can get that working.


good luck.


Message was edited by: Frank Caggiano -Link to workflow https://www.dropbox.com/s/g5oc3sbjqyuo5p2/LabelScreenShots.zip

Need help with folder action

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.