You can get the file-system path of a photo with photo:getRawMetadata ("path").
Plugins can add new photos to the catalog -- see catalog:addPhoto(). Any metadata within those photos will also be imported into the catalog. In addition, a plugin can add additional metadata using the methods supported by the LrPhoto class. However, those methods are infuriatingly incomplete -- e.g. there's no way to modify capture time.
If you have more specific questions, shoot away.
Thank you. I already figured it out by searching the whole internet
But there's a thing bugging me. I want to delete the log file in which all paths are stored because everytime I run the plugin I get duplicates of the paths.
So I thought of removing the existing log file before every time I use the plugin.
I tried LrTasks.execute("del %HOMEPATH%\\Documents\\photosPath.log"). But nothing happens. When I use my personal path then it works pretty well. But I want it to work on any computer....
Don't know offhand why that doesn't work. But if you want your plugin to work on both Mac and Windows, it would be better (and easier) to use LrFileUtils.delete().
Thanx. It helped a lot!