eltos / PasteIntoFile

Paste clipboard data into files and copy file contents directly via hotkey or context menu
MIT License
90 stars 5 forks source link

Allow absolute path in template(s) #56

Open eltos opened 5 days ago

eltos commented 5 days ago

Filename can already be a relative path with subfolder structures. Allow it to be an absolute path, too. If it is, disable and ignore the folder input field and show a hint if the user tries to click the "..." button. Same for autosave mode.

Also allow the subfolder template (which applies only if the user holds SHIFT) to be an absolute path, in which case it replaces the location when initialising the folder input field (instead of appending to it).

Specification and constraints

If "may open explorer window" option is disabled, autosave mode enabled and the filename temple contains a path fragment (absolute or relative), then

show a warning that this combination will lead to files being created out of sight.

Alternatives Most use cases for absolute paths are probably of temporary nature such that they can be handled by batch mode. A permanent absolute path would make the folder context menu entry somewhat useless and confusing (hence the warning suggested above). But there might be use cases when the program is used solely with hotkey as a "send to xxx folder" tool.

pa-0 commented 1 day ago

I realize this is probably just a note to yourself, but reading through this -- I think you're logic is sound. I think having an absolute path makes the context menu useless.... unless the option is available to assign an absolute path exclusively to the hotkey. That way, the user has the option to store files in a dedicated path (e.g., they're 'web clippings' or 'notes' folder or even an 'unsorted' folder, etc.) and the explorer option then becomes handy when the user wants to override that behavior. Just my 2 cents.

eltos commented 13 hours ago

Thank you for sharing your thoughts @pa-0, always very welcome 😊

What you are saying basically boils down to allowing absolute paths (only) in the subfolder template (which applies if the user holds SHIFT). I would not introduce separate templates for default hotkey and context menu usage actually, i.e. introduce a 3rd template, since that would be confusing.

So usage of either context menu or hotkey WIN+ALT+V results in "current folder + filename template". Usage of either context menu + CTRL or hotkey WIN+ALT+CTRL+V results in "subfolder template + filename template" if subfolder template is an absolute path, otherwise "current folder + subfolder template + filename template" as currently.

Indeed absolute paths in the filename template are probably not needed.