# Saving files with comments for Spotlight (?)



## JonKemerer (May 15, 2005)

Hiya:

I'm not really sure where to ask this at: 

I'm trying to figure out how to save files with Finder comments (for Spotlight) on-the-fly.  Like for example... if I'm browsing a website and want to save an image, is there an easy way to add comments to it without having to search and find it, and add comments later?  

Many thanks in advance.  

- Jon K.


----------



## Mikuro (May 15, 2005)

You could create an AppleScript folder action to add comments to every new file added to your download folder. Something like this would do the trick:
	
	



```
on adding folder items to this_folder after receiving added_items
	
	tell application "Finder"
		repeat with i from 1 to the count of added_items
			set filename to the name of item i of added_items
			if filename does not end with ".download" and filename does not end with ".part" then
				--this keeps it from commenting incompleted downloads, at least from some browsers
				
				set dialog_result to display dialog ("Enter comment for '" & filename & "':") default answer ""
				set the comment of item i of added_items to the text returned of dialog_result
			end if
		end repeat
	end tell
end adding folder items to
```

For convenience, I'll also attach the script to this message. Put it in "/Library/Scripts/Folder Action Scripts", then control-click your downloads folder and select "attach script".


----------



## quiksan (May 16, 2005)

My way uses Quicksilver.  If you're not using it, I recommend it above ALL OTHER APPS.  seriously great.

anyway, if you're already familiar with Quicksilver, then you need to make sure you've got the beta enabled with development builds.  in the plugins section, make sure you've got the File Attributes Actions installed.

now, select whichever file you want to tag with comments.
invoke QS
CMD G will load the selected file(s) into QS
tab
set comments
tab
enter whatever comments or tags you want to show in that file's Spotlight COmments
Enter

that may look like a long list of steps, but if you use QS, it's about a 1.5 second process.  it's SO useful.  I've begun tagging all my files flickr style.  makes spotlight much more useful for me.

hope that helps you out.

Oh - and if you're not a QS fan/user, you can create an Automator workflow (it's 2 steps) to do the same thing.


----------



## Stubaan (Aug 9, 2011)

Mikuro said:


> You could create an AppleScript folder action to add comments to every new file added to your download folder. Something like this would do the trick



This doesn't seem to work on my system - selected the script as an added folder action but it never appears as an option anywhere.



quiksan said:


> My way uses Quicksilver.



This way is cool, but what I'm looking for is a means to tag while the file is still open, or as an option when I save the file.  As I work new tags become necessary and it's no help having to shut the file down only to tag it and then reopen to continue working.


----------

