Performing actions on the current file with "Set File Attribute"

I know that there are KM macros for tagging selected files in Finder, but what I"m looking for is a macro that can be launched from within an application, tagging the currently active file. Say, if I have a Keynote file open, and I want to rename it or give it a quick tag before closing it. The “Set File Attribute” seems to be the way to do this, but can anyone tell me how to get the filename of the currently active/focal file, so as to use it in the “of file” field – after “Set tags (add)” ?

Thanks!

Hi, do you think that just saving the file open in Keynote (which I think is what you mean by active) and performing a tagging operation on the last saved in the folder file would do the trick? Usually a file open in a program can’t be renamed, unless I don’t under stand how Keynote works. However I have seen how Keyboard Maestro can get access to a programs menu. This would lead me to think of a “Save As” to do the renaming you want. Then continue with the tagging.