Save TextEdit document and set Finder tag?

Hey Bern,

You cannot set a tag prior to saving the document, unless you work with the save dialog UI.

See @DanThomas' macro (here) for the basics of doing that.

This method will be much slower than mine, but it's easier to understand.

If you want to use mine then the simplest thing to do is to add the save location/file-name and the tags as line 1 and line 2 of the document.

If you have favorite save-locations, you can create text-abbreviation macros for them.

So, you hit Cmd-N.
Type “tdir” (or whatever your abbreviation for the desired directory is).
Type the file name and <return>.
Type the tags (or use 1 or more abbreviation macros to do it for you).

You end up with an unsaved document that looks like this:

/Users/chris/test_directory/<file name>
tag1, tag2, tag3
<blank line>
Your text ...

You hit your Save macro, and the document instantly saves to the given destination with the given tags, and the first three lines are automatically deleted.

Of course this can be adjusted to account for no tags and/or a missed blank line between the header and your text.

You could even use a Prompt with List action to pop-up and provide you with any number of save locations for line one.

If you commonly save these documents to the same place you could have a create new document macro that automatically emplaced the default directory and any default tags for you.

TextEdit is NOT very scriptable, but this method makes saving fast and flexible.

On the other hand – IF you want to freely navigate the file system in a save dialog then this method is NOT for you.

Is this starting to make sense?

-Chris