Automator Folder Actions - problems generating apple script from automator

Hi,

I'm relatively new to Mac OS X but have been experimenting with it's various applications, most recently Automator. After some early success - managed to create a Automator app. that dismounts my external LaCie HD when I push the button on the housing! - I've now run into problems with "Folder Actions".

Here's what I'm trying to do:
I want to have folder that when WMA music file is dropped into it, automator opens Switch (conversion app.) and drops all new files into Switch, converts files to Mp3 and imports them into iTunes.

I actually have created a workflow that does precisely this (using 'watch me do') but when I try to use it as a folder action it doesn't work.

According to this article : http://www.peachpit.com/articles/article.aspx?p=1215430,

"When you save an Automator workflow as a Folder Action plug-in, Automator actually saves your workflow as an application into the ~/Library/Workflows/Applications/Folder Actions/ folder. It then creates an AppleScript file in the ~/Library/Scripts/Folder Action Scripts/ folder and attaches it to the folder you’ve specified."

I think i have identified the problem - automator (or apple script editor?) is not creating an applescript file in the 'Library/Scripts/Folder Action Scripts ' directory when I save as a folder action plug-in (just as an app. in 'user/library/workflows/applications/folder actions' ) .

Consequently there is no .scrpt file to add to the folder in 'configure folder actions' window.

I just cannot get automator to make this apple script file, (and don't have a clue as to how to make it in applescript editor!) and wondered if anyone has had similar problems or has a solution! Do I need to reinstall automator? Is there a setting I've missed?

Thanks for any help - apologies if this is long-winded!

MacBook Pro, Mac OS X (10.5.4)

Posted on Jul 28, 2008 5:33 AM

Reply
6 replies

Jul 28, 2008 8:10 AM in response to Tom.H

I suspect you identified the wrong reason. ~ means your home directory, i.e /Users/your-user-name

therefore automator creates an apple script in /Users/your-user-name/Library/Scripts/Folder Action Scripts not in /Library/Scripts/Folder Action Scripts. look there and I'm sure you'll find the .scpt file.

make sure that when you save your workflow as an action you check the box "enable folder actions".

However, I'm afraid your main problem is that you are using "Watch me do it". that generally works extremely badly and will fail at a slightest provocation.

Jul 28, 2008 8:52 AM in response to V.K.

Thanks for your help V.K. - unfortunately I still think automator is not creating requisite .scpt file:
There appear to be three relevant locations:

1) Macintosh HD/library/scripts/folder action scripts - this folder contains .scpt files offered to me to attach to a folder in "folder actions setup" including useful 'new item alert' example (which works).

2) Macintosh HD/users/your-user-name/library/scripts/folder action scripts - this folder is empty

3) Macintosh HD/users/your-user-name/library/workflows/applications/folder actions - this folder contains app. files generated by Automator when i save a workflow as a folder actions plug-in.

I have again tried to create simple folder actions plug-ins (duplicate files , copy files), the app. file is created but alas no .scpt file! 'enable folder actions is checked'. I have also searched for all .scpt files - my custom ones are not there.

Incidentally, 'watch me do it' works well so far....I can run my workflow as a finder app. with no problems. Are you running 10.5.4?

Any further ideas? - really irritating as everything else encountered in OS X is great!

Jul 28, 2008 9:07 AM in response to Tom.H

ok, this is very strange. you are right and it doesn't seem to be creating the. scpt file. It ought to place it in Macintosh HD/users/your-user-name/library/scripts/folder action scripts

That's how it works for me. something is buggy on your system. try creating a new workflow, save it as a folder action and see if it works better this time around. also, try doing it from a different user account.

Finally, you can try making that .scpt file yourself. that's pretty easy actually.

Open script editor and paste the following into it.

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
on adding folder items to this_folder after receiving added_items
tell application "HD-name:Users:your-username:Library:Workflows:Applications:Folder Actions:your-folder-action.app"
open added_items
end tell
end adding folder items to</pre>

Put your HD name, your user name and your workflow name in the above and save it as a script inside HD/users/your-user-name/library/scripts/folder action scripts.

Next, choose a folder you want to attach it to, control-click on it and select
More->attach a folder action" and attach the .scpt file you've just made.

Jul 29, 2008 10:53 AM in response to V.K.

Hello V.K.

You'll be glad to know problem is fixed! As so often the case, it transpired to be something very (annoyingly) simple.
The update is I phoned up Apple support to get their take on it - two of the team couldn't figure out what the problem was but recommended an 'archive and install' - which i duly did. Of course made no difference!

I wiped the drive and reinstalled mirror of my system using timemachine from ext. drive.

The denouement:

Today I visited apple store. The second 'genius' at the bar worked out from error messages on console / system monitor that because I had a '\' character accidentally inserted at 'Macintosh HD\' it had caused automator to drop the pathway (some sort of bug' . Once HD name changed back - it worked!

Thanks for your time and assistance.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automator Folder Actions - problems generating apple script from automator

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