YMP wrote:
Suppose C:\Folder1\Example-1.doc already exists, what should be done?
Well, ideally it'd save the next version with a "-2" at the end of its name. And so on ("-3," "-4," etc.). But that's way ahead of where I am now. I'm a newbie. (Obviously.) I'm trying to figure out the basics first!
Let me ask a slightly different question. It's probably a basic one, and I'm sorry—I've tried for hours to figure this out for myself. Let's say that you've selected a file on your computer; that is, you haven't opened it but rather, say, single-clicked it with your mouse. Is there a way, using AutoHotkey, to get that file's
directory location? I know you can easily get that file's full name by doing this:
Code:
Send ^c
{whatever command you want} %clipboard%
That'll include both the directory location and the file name. Can you please show me a way that I can get
only the directory location? Because then, I figure, I can just run a variant of FileCopy.
Perhaps, for example, I can temporarily make whatever folder I'm in into the working directory. Right now, when I run a script fragment like the one I showed above:
Code:
SetWorkingDir, %clipboard%
FileCopy, %clipboard%, %A_WorkingDir%\*-1.*
it doesn't work. If, however, instead of "%clipboard%" I could substitute, you know, something signifying "whatever folder is currently active," then I think it'd work. (This would kind of be like WinGetActiveTitle except that, instead from giving me the
title of the active window, I'd get the
location.)