Folder Action Script won't work

Why can’t I seem to get this script to work:

on adding folder items to folder after receiving the_added_files
repeat with the_file in the_added_files
tell application “Adobe Photoshop CS”
open the_file as JPEG
end tell
end repeat
end adding folder items to

Try this:

on adding folder items to folder after receiving the_added_files
    tell application "Adobe Photoshop CS"
        repeat with the_file in the_added_files
            --you should test for file type but a try will suffice for now
            try
                open the_file as alias
            end try
        end repeat
    end tell
end adding folder items to

The “as JPEG” code is really meant to coerce data from one type to another, not to change a file type. For file references for opening files, use “alias” or “file”.

Jon

I can’t even seem to get the simplest of folder actions to work. Does the the action need to be attached to the folder again after being edited even if it’s already attached? Can I only attach .scpt files or can I attach .app scripts too? Do the scripts need to located somewhere special?

I’ve tried both of these and do not get the dialog box:

on adding folder items to this_folder after receiving these_items
tell application “Finder”
display dialog “There it is.” buttons (“OK”) default button 1
end tell
end adding folder items to

on adding folder items to this_folder after receiving these_items
display dialog “There it is.” buttons (“OK”) default button 1
end adding folder items to

Any suggestions are much appreciated.

Put the script in Users/you/Library/Scripts/Folder Action Scripts

Right-click on the folder

Choose “Enable Folder Actions”

Choose “Attach a folder action”

Choose the script from the menu in the dialog box.

Thanks for the help.

BTW, if anyone reading this knows Image Events well, could you view my other post regarding metadata tags and how to set them.

Thanks,