Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


try this | 16 comments | Create New Account
Click here to return to the 'try this' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
try this
Authored by: Graff on Oct 30, '03 11:35:28PM

I just tested all of the modifications listed above and here is a script that works fine:

on adding folder items to this_folder after receiving added_items
  tell application "Finder"
    set homeFolder to (container of (path to desktop folder) as string)
    set folderLocation to homeFolder & "Pictures:unfiled:"
    repeat with aFile in added_items
      if the name extension of aFile is in ¬
        {"jpg", "gif", "png", "pict", "tiff", "gif", "psd", "bmp"} then
        tell application "Finder"
          try
            move aFile to folder folderLocation
          on error err
            display dialog err
          end try
        end tell
      end if
    end repeat
    display dialog ¬
      "Image files have been moved to the Unfiled" & return & ¬
      "folder in your Pictures folder."
  end tell
end adding folder items to

If this doesn't work for you then make sure that you have run the "Enable Folder Actions" script and have successfully attached a folder action to the folder you want this script to run from. For a good reference on how to get it all to work see Apple's web page on Folder Actions.



[ Reply to This | # ]
try this
Authored by: Shippley on Oct 19, '05 08:23:30PM
I moved the dialoge box telling me that image files had been moved because it was saying it no matter what I added..
on adding folder items to this_folder after receiving added_items
	tell application "Finder"
		set homeFolder to (container of (path to desktop folder) as string)
		set folderLocation to homeFolder & "Pictures:unfiled:"
		repeat with aFile in added_items
			if the name extension of aFile is in ¬
				{"jpg", "gif", "png", "pict", "tiff", "gif", "psd", "bmp"} then
				tell application "Finder"
					try
						move aFile to folder folderLocation
					on error err
						display dialog err
					end try
					display dialog ¬
						"Image files have been moved to the Unfiled" & return & ¬
						"folder in your Pictures folder."
				end tell
			end if
		end repeat
	end tell
end adding folder items to


[ Reply to This | # ]