Need a simple folder action

I’m not a programmer (anymore) and, while it’s probably a very simple script for someone who knows how, I can’t figure it out.

I want to attach a folder action to /Volumes/Photographic/Pictures/Best Shots

that will copy any file I insert into that folder to /Volumes/Photographic/Pictures I Like
and
/Volumes/Photographic/net/To Be Posted

You may assume the filenames will be unique.

The files will be saved there via Photoshop’s File Save As.

Can someone help me, please?

Thanks,
Mark :slight_smile:

Model: PowerPC G5
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi Mark,

try this:

on adding folder items to this_folder after receiving these_items
	tell application "Finder"
		duplicate every item of this_folder to folder "Photographic:Pictures I Like:"
		move every item of this_folder to folder "Photographic:net:To Be Posted:"
	end tell
end adding folder items to

Thanks, Stefan.
I’m not ungrateful for the help, but it seems a little inelegant if I have to copy everything from one folder to another. I just want to copy the single item that’s NEW (that’s being saved into the folder by Photoshop).

Is there a way to tweak your script to do that?

Best,
Mark

It works also with only one file.

If one file is added into the hot folder, one is copied.
If several - several

It’s only a problem if source and destination folder are not on the same volume

I must have taken stupid pills today, Stefan, because it’s still not clear.

Let’s assume the ‘hot folder’ already contains 291 files and I’m adding 1 file to it. Are you saying only the one new one will be copied? It looks like all 292 file will be copied.

Thanks for clearing this up for me.

Mark

I assume, that we start with an empty folder :wink:

O.K. if you want to keep the existing files in the hot folder,
the code must be changed:

on adding folder items to this_folder after receiving these_items
	repeat with this_item in these_items
		tell application "Finder"
			duplicate this_item to folder "Photographic:Pictures I Like:"
			move this_item to folder "Photographic:net:To Be Posted:"
		end tell
	end repeat
end adding folder items to

:slight_smile:
Thank you. That looks like it will work.

Mark

Hi,

You don’t need the repeat loop. Duplicate takes a list:


on adding folder items to this_folder after receiving these_items
	tell application "Finder"
		duplicate these_items to folder "Photographic:Pictures I Like:"
		duplicate these_items to folder "Photographic:net:To Be Posted:"
	end tell
end adding folder items to

I also changed the ‘move’ to duplicate. Didn’t the op want to copy the items?

gl,

:wink:
Thanks, Kel