Moving items from a folder to mailboxes

I don’t know how to write scripts, but I was wondering if soomeone knew how to do the following:

Make a folder’s dock icon (ie, Public Folder) display the same count icon as the mail.app dock icon.

Alternately, is there a way to move newly added items from a folder directly to a mail.app mailbox?

Any info on scripts that perform similar functions would be appreciated.

Thanks,
Sam Altman

I doubt that it’s possible.

Can you elaborate on why you need to do this and tell us where the files come from? I’m not being nosey but there might be more than one way to accomplish the goal. It will also be helpful to know which versions of OS X and Mail are in use.

– Rob

Basically, I have a small network of computers at home, and family members will often drag items to my computer (where they show up in my public folder). I tried using the standard add item alert folder action, but didn’t really want to see an alert pop up every time something was added. If I could automatically transfer these new items to a mail.app folder, I could incorporate new public folder items into mail.app’s very unobtrusive, and yet informative, alert system.
My computer is a Powerbook G4(12"867) running Panther10.3.3 (Mail 1.3.4), and the other computers on the network are all G4’s running the same version of OSX. Thanks again, in advance.

-Sam Altman

Can you elaborate on why you need to do this and tell us where the files come from? I’m not being nosey but there might be more than one way to accomplish the goal. It will also be helpful to know which versions of OS X and Mail are in use.

– Rob
[/quote]

This folder action should move the items to the folder of your choice. You need to enter the path to the folder that you want the items moved to. The script might fail to move some or all of the items when newly arrived items have the same name as items which are already present in the new location. This can be overcome with a renaming routine so, if it is an issue, the script will need further devlopment.

on adding folder items to this_folder after receiving added_items
	tell application "Finder" to ¬
		try
			move added_items to folder "path:to:new location:" --<-- Modify this path
		end try
end adding folder items to

– Rob

If you search a little, there have been plenty of threads (with lots of scripts) that show how to auto-sort incoming files based on name or file type into appropriate folders (Pictures, Music, Movies, Documents, etc.) or even to just create date based subfolders and move organize files that way.

Jon

Thanks for the script, and the advice, but the problem of moving files to a mailbox folder still remains. They are not regular folders, and you can’t drag stuff into them (The actual mbox icons in the Library/Mail folder). Any way to circumvent this problem?

-Sam

Thanks for the script, and the advice, but the problem of moving files to a mailbox folder still remains. They are not regular folders, and you can’t drag stuff into them (The actual mbox icons in the Library/Mail folder). Any way to circumvent this problem?

-Sam

I don’t think he wants a sorter script. He wants a script that will display the number of new items in his folder, similar to the way mail displays the number of new messages (w/ the red icon thingy). I doubt this is possible, but I have a suggestion. Try a program called iNotify.

here is a little code I whipped up with existing images:


on adding folder items to thisFolder
	tell application "iNotify" to create new notification image "Mail.mov" sound "Chime.aif"
end adding folder items to

you can try the program for free, and it only cost fiv bucks. this is also much more discreet, no buttons and the such. you will need iNotify for that script to work, but you can make active links on the desktop as well as a host of other things using apple script.

Putting possibly negative consequences aside, this works for me.

property fol : "YOUR HARD DRIVE NAME:Users:YOUR USER NAME:Library:Mail:Mailboxes:MAILBOX NAME.mbox:"

on adding folder items to this_folder after receiving added_items
	tell application "Finder" to ¬
		try
			move added_items to alias fol
		end try
end adding folder items to

– Rob

by possible nagative consiquences, you mean what??? :?

This is great, but I would like to make it so that the image stays up until I click it (So if I’m away from the computer, I’ll see it when I get back.) I guess I can have that image be anything I want. Thanks a lot.

As for the move script that was posted, it seems to make the added item vanish. Searching for the moved item comes up with nothing (just vanishes, sort of cool). I fthis worked, it’d be perfect. I’m probably doing something wrong. Thanks to everyone who posted for the help.

-S

[quote=“boy8cookie”]
I don’t think he wants a sorter script. He wants a script that will display the number of new items in his folder, similar to the way mail displays the number of new messages (w/ the red icon thingy). I doubt this is possible, but I have a suggestion. Try a program called iNotify.

here is a little code I whipped up with existing images:


on adding folder items to thisFolder
	tell application "iNotify" to create new notification image "Mail.mov" sound "Chime.aif"
end adding folder items to

It sounds to me like it worked. A normal Finder search doesn’t look within packages (as far as I know) so this is likely the reason that you can’t find the item. If the added item vanished from the attached folder then it is likely located within the mbox package whose path was targeted by the script. Find the mbox file, control-click on its icon and choose “Show Package Contents” from the contextual menu.

– Rob

Scripts and applications can do unexpected things and/or expected things with unexpected results. :wink:

For one thing, I don’t know how Mail will react to foreign files within a mbox package. For another, I suppose that it’s possible, but not likely, for the script to misfire and overwrite files with the same name. If this could happen, it would be possible for someone to send a file with the same name as one of the mbox package’s original files and screw everything up. :rolleyes:

– Rob (the cautious one)

Whad’ya know, show package contents reveals the missing files! Very cool, but unfortunately, Mail doesn’t seem to know how to do anything with alien files or folders. They don’t show up at all. Thanks, again. What I guess I should do is try to set up a local mail server, from my public folder, and set mail to check that. Not sure if that’s possible though. Anyway, thanks.

-Sam

It sounds to me like it worked. A normal Finder search doesn’t look within packages (as far as I know) so this is likely the reason that you can’t find the item. If the added item vanished from the attached folder then it is likely located within the mbox package whose path was targeted by the script. Find the mbox file, control-click on its icon and choose “Show Package Contents” from the contextual menu.

– Rob
[/quote]

I didn’t really expect Mail to do anything special with the moved items but I thought that you might have info that I was unaware of.

– Rob

I’m really confused by this whole thread. What is the point of moving the files to mailbox folders?

Jon

You got me. I guess there is no point. :?

– Rob